JDK 9 RFR of JDK-8164524: Correct inconsistencies in floating-point abs spec
Brian Burkhalter
brian.burkhalter at oracle.com
Mon Aug 22 18:41:55 UTC 2016
Hi Joe,
This doc-only patch appears reasonable to me. Approved.
Brian
On Aug 20, 2016, at 11:55 AM, joe darcy <joe.darcy at oracle.com> wrote:
> Please review the doc-only patch below to address
>
> JDK-8164524: Correct inconsistencies in floating-point abs spec
>
> In brief, Martin noted in JDK-8164199 that a close reading of the specification of the Math and StrictMath floating-point abs methods reveals some inconsistencies in the text of the specification versus the operational semantics of the sample code in term of NaN handling.
>
> To resolve this, the sample code is slightly modified and demoted to informative rather than normative text.
>
> The core of the edit is changing
>
> Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a))
>
> to
>
> Float.intBitsToFloat(0x7fffffff & Float.floatToRawIntBits(a))
>
> that is the "raw" floating-point => integral conversion rather than the "cooked" one which has tighter behavioral requirements around different NaN values, analogous changes for the double cases.
More information about the core-libs-dev
mailing list