nai*_*rbv 3 java floating-point jvm scala jvm-languages
我最近在Java虚拟机规范中读到JVM不支持NaN值,也不支持信号溢出的方法.
我特别指的是jvms 7的第2.8.1节,JVM支持的浮点运算和IEEE 754之间的主要区别,这一点指出:
"The floating-point operations of the Java Virtual Machine do not throw
exceptions, trap, or otherwise signal the IEEE 754 exceptional conditions of
invalid operation, division by zero, overflow, underflow, or inexact. The Java
Virtual Machine has no signaling NaN value."
Run Code Online (Sandbox Code Playgroud)
我错过了解这个吗?在Scala(它依赖于字节码中的Java原语来表示数字类型),以及Java的Double对象中,有一个NaN和一个正/负无穷大值(在Java中记录了相应的二进制值).如果JVM不支持它们,如何有效地处理这些问题?
| 归档时间: |
|
| 查看次数: |
273 次 |
| 最近记录: |