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:
- Linguistically legislated exact reproducibility is at best mere wishful thinking.
- Of two traditional policies for mixed precision evaluation, Java chose the worse.
- 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.
- 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.
- 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.