FYI, planned update of floating-point terminology in JLS and JVMS to IEEE 754-2019
Joe Darcy
joe.darcy at oracle.com
Wed Apr 22 19:17:11 UTC 2020
Hi Florian,
On 4/22/2020 11:44 AM, Florian Weimer wrote:
> * Joe Darcy:
>
>> The Java Language Specification (JLS) and Java Virtual Machine
>> Specification (JVMS) use terminology from and make reference to the 1985
>> release of the IEEE 754 floating-point standard. The IEEE 754 standard
>> from 1985 has been superseded, most recently by a release from 2019.
> I don't have access to the IEEE standard (yeah, I know …), but there
> are rumors that the Math::min and Math::max implementations for
> floating point arguments now match some IEEE 754 operation. If this
> indeed ttrue, it would make sense to update the Javadoc accordingly.
>
> (This goes in the opposite direction of what JDK-8240632 is about.)
One part of JDK-8240632 I'm considering is a table mapping between IEEE
754-2019 operation/recommended operation and the Java math library
equivalent. Many of them would be obvious, (sin -> sin, cos -> cos,
etc.), but there are some that differ in their details.
Java Math.{min, max} have always specified the fine detail that -0.0 is
treated as strictly less than +0.0 and that if either argument to
min/max is a NaN, the result is also a NaN.
IEEE 754-2008 added minNum/maxNum operations. These did *not* require
-0.0 to be treated as less than +0.0 and do not propagate a NaN value in
case one argument is non-NaN.
IEEE 754-2019 added minimum/maximum operations that do correspond to the
Java library definitions of min/max and updated minNum/maxNum to
distinguish between signed zeros.
HTH,
-Joe
More information about the jdk-dev
mailing list