Java for HPC? Oops, Wrong Answer

Print Friendly, PDF & Email

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.


  1. […] This post was mentioned on Twitter by insideHPC and Aaron Hicks, Fitz. Fitz said: RT @insideHPC: Just in: Java for HPC? Oops, Wrong Answer #HPC […]