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
既存の実装が完全に準拠していない理由を説明することがうれしいです。 –
説明を参照してください。 –
私はソフトウェア実装がないと思っていましたが、反対にオープンソースの実装が全くないように思われるのは幾分驚いています。 – Durandal