2012-07-13 6 views
8

は、任意のJavaを省略することにしたすべての機能のサポートを提供するJavaで利用可能な完全準拠IEEE754rの実装(または一般的にはかなり高いレベルの言語を省略したい)がありますJava用のIEEE754(r)準拠の実装ですか?

  • トラップ
  • スティッキーフラグ
  • 監督丸めモード
  • 長い/拡張倍精度
  • クワッド精度
  • DPD(稠密充填小数)

誰かが間違って取得する前に明確化:私はJVMが上記のサポートを提供するのではなく、タイプと操作をソフトウェアで実装するクラスだけでなく、プリミティブラッパークラスFloat/Double。以下、次のsource実装された機能を持つ

答えて

5

いいえ、完全に準拠したIEEE754R実装は存在しません。 Javaだけでなく、現在利用可能なすべての言語(状況7月2012)。

EDIT:ポスターは、IEEE 754-2008と同じIEEE 0124 Rのサポートを求めました。そのようなことがない理由をすべて追加したいのであれば、これは長くなるだろう。

  • トラップは:いいえ、SIGFPEでオーバーフロー、アンダーフロー、INEXACTなどで独自のルーチンを呼び出すことはできません トラップ。 IEEE754(古いもの)pを参照してください。トラップを構成するものについて21。 シグナリングNaN。 NaNペイロードアクセス。アクセスをフラグする。 これを実行できる言語を列挙します。

  • 丸めモード:新しい標準ではroundTiesToAway(16ページ)を新しい丸めモードとして定義しています。 残念ながら、AFAIKにはこのモードをサポートするプロセッサはなく、 もソフトウェアエミュレーションはありません。

  • クワッド精度:非常に少数のコンパイラでのみサポートされ、壊れていないコンパイラはさらに少なくて済みます。

  • 密集した小数点:おそらく小数点を使用する言語でのみサポートされます。 COBOL。

すべてのセットの交差:空集合。なし。何もない。

+0

既存の実装が完全に準拠していない理由を説明することがうれしいです。 –

+0

説明を参照してください。 –

+0

私はソフトウェア実装がないと思っていましたが、反対にオープンソースの実装が全くないように思われるのは幾分驚いています。 – Durandal

0

This

double nextAfter(double x, double y) - returns the double adjacent to x in the direction of y 
    double scalb(double x, int e) - computes x*2e quickly 
    boolean unordered(double c1, double c2) - returns true iff the two cannot be compared numerically (one or both is NaN) 
    int fpclassify(double value) - classifies a floating-point value into one of five types: 
     FP_NAN: "not any number", typically the result of illegal operations like 0/0 
     FP_INFINITY: represents one end of the real line, available by 1/0 or POSITIVE_INFINITY 
     FP_ZERO: positive or negative zero; they are different, but not so much that it comes up much 
     FP_SUBNORMAL: a class of numbers very near zero; further explanation would require a detailed examination of the floating-point binary representation 
     FP_NORMAL: most values you encounter are "normal" 
    double copySign(double value, double sign) - returns value, possibly with its sign flipped, to match "sign" 
    double logb754(double value) - extracts the exponent of the value, to compute log2 
    double logb854(double value) - like logb754(value), but with an IEEE854-compliant variant for subnormal numbers 
    double logbn(double value) - also computing log2(value), but with a normalizing correction for the subnormals; this is the best log routine 
    double raise(double x) - not actually an IEEE754 routine, this is an optimized version of nextAfter(x,POSITIVE_INFINITY) 
    double lower(double x) - not actually an IEEE754 routine, this is an optimized version of nextAfter(x,NEGATIVE_INFINITY) 

「これらのルーチンはすべて、引数のみが異なる、フロートバリエーションを持ち、型を返すクラスがorg.dosereality.util.IEEE754である。」

Sun bug reference 2003

+0

私がソースの肉を完全に見逃していない限り、それは私が求めたもののほんのわずかな部分だけです。 – Durandal

+0

@Durandalはおそらくそれを全く見逃さなかったでしょう。これは私が情報の一部を提供していることがわかったものでした。 – Woot4Moo

関連する問題