任何符合IEEE754(r)标准的Java实现?

是否有任何完全符合IEEE的IEEE754r实现可用于Java,它们支持Java选择省略的所有function(或者更确切地说是高级语言,如省略):

  • 陷阱
  • 粘滞的旗帜
  • 定向舍入模式
  • 延长/长双
  • 四精度
  • DPD(密集小数)

在任何人弄错之前澄清:我不是在寻找JVM来为上面提供任何支持,只是在软件中实现类型和操作的一些类,基本上是已经存在的原始包装类的样式Float /双。

不,没有完全符合IEEE754R的实现。 不仅在Java中,而且在所有当前可用的语言中(Status July 2012)。

编辑:海报要求IEEE754 R支持,这与IEEE 754-2008相同。 如果我想添加所有原因,为什么没有这样的事情,这将是很长的。

  • 陷阱:不,使用SIGFPE调用OVERFLOW,UNDERFLOW,INEXACT等自己的例程并不是陷阱。 参见IEEE754(旧版)p。 21是什么构成陷阱。 信令NaNs。 NaN有效负载访问。 标记访问。 枚举可以做到这一点的语言。

  • 舍入模式:新标准将roundTiesToAway(第16页)定义为新的舍入模式。 不幸的是,AFAIK没有处理器支持这种模式,也没有软件仿真。

  • 四精度:仅在极少数编译器中支持,甚至更少的编译器也不受损坏。

  • 密集的Decimals:可能只支持使用小数的语言,例如COBOL。

所有集合的交集:空集。 没有。 没有。

这具有以下源实现的function:

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参考2003