Tr : double a%b returns NaN for some (a,b) (|a| < inf, |b|>0)

Jeff Hain jeffhain at rocketmail.com
Tue Feb 12 14:52:33 PST 2013


Joe Darcy wrote:

>For the non-NaN floating-point values, I recommend using hexadecimal 
>floating-point syntax rather than calling Double.longBitsToDouble on a 
>hex string value; see Double.toHexString for details.


It should be more readable for humans indeed, but I guess my transformation
into a processor is now irreversible ;)



>you can add the "strictfp" modifier to remove one source of possible variance.


Still happens with strictfp.
(about strictfp, off-topic but I removed it from all my code after
someone pointed out it added some overhead (like 20ms+ on
10_000_000 calls micro-benchmarks, so about 2ns+), when
having strictfp code call non-strictfp code or the opposite)



-Jeff


More information about the hotspot-dev mailing list