Tuesday, October 29, 2013

How Java’s Floating-Point Hurts Everyone Everywhere

John Carmack found an interesting 1998 paper by William Kahan and Joseph D. Darcy (PDF):

Java’s floating-point arithmetic is blighted by five gratuitous mistakes:

  1. Linguistically legislated exact reproducibility is at best mere wishful thinking.
  2. Of two traditional policies for mixed precision evaluation, Java chose the worse.
  3. Infinities and NaNs unleashed without the protection of floating-point traps and flags mandated by IEEE Standards 754/854 belie Java’s claim to robustness.
  4. Every programmer’s prospects for success are diminished by Java’s refusal to grant access to capabilities built into over 95% of today's floating-point hardware.
  5. Java has rejected even mildly disciplined infix operator overloading, without which extensions to arithmetic with everyday mathematical types like complex numbers, intervals, matrices, geometrical objects and arbitrarily high precision become extremely inconvenient.

Darcy went on to work for Sun to improve the situation.

Comments RSS · Twitter

Leave a Comment