RFR: 8368349: Add library notes discussing abs and IEEE 754 operations

Joe Darcy darcy at openjdk.org
Tue Sep 23 22:49:37 UTC 2025


On Tue, 23 Sep 2025 17:11:01 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> I checked 754-2008, which requires a 0 sign bit, and 754-1985 (reaffirmed in 1990), which in the annex on recommended functions reads
> 
> > Copysign(x,y) returns x with the sign of y. Hence, abs(x) = copysign(x,1.0), even it x is NaN.
> 
> So it seems that hardware that does not behave this way is not compliant. I'm curious what other platforms specify.

Let me do some more research and get back.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27443#issuecomment-3325792856


More information about the core-libs-dev mailing list