Tag: Java
All the articles with the tag "Java".
Two NaNs, One Expression: The Bits Nobody Promised
Updated:`0.0 / 0.0` gives one NaN when `javac` folds it and a different one when the CPU divides it, on the same JVM. The JVM spec leaves the bit pattern to the hardware and IEEE 754 does not specify it either, so my port now only promises the finite results.
How To Implement a Correctly-rounded powf(x, 3)
Updated:`x * x * x` is wrong for about 8.5% of all positive finite float32 inputs, while there actually is an easy way to implement a correctly-rounded one.