Java for HPC? Oops, Wrong Answer

Rick Regan from the Exploring Binary blog writes that Java produces incorrect answers when it does nondeterministic floating-point conversions:

Recently I discovered that Java converts some very small decimal numbers to double-precision floating-point incorrectly. While investigating that bug, I stumbled upon something very strange: Java’s decimal to floating-point conversion routine, Double.parseDouble(), sometimes returns two different results for the same decimal string. The culprit appears to be just-in-time compilation of Double.parseDouble() into SSE instructions, which exposes an architecture-dependent bug in Java’s conversion algorithm — and another real-world example of a double rounding on underflow error.


 

Like what you're reading? Come back every day for HPC news, or subscribe to email or RSS updates. Trackback URL: http://insidehpc.com/2011/02/25/java-for-hpc-oops-wrong-answer/trackback/

Leave your own comment

Advertisement

Intel Truescale White Paper Ad

insideHPC.com is a production of insideHPC, LLC. © 2006-2013 Sitemap