This is a rant we came across in the early design of Rust and eventually decided was pretty misguided. Very few languages actually address these complaints.<p>The biggest complaint here is that, in Java, when you perform arithmetic on 32-bit floats you perform 32-bit arithmetic with 32-bit intermediate results. Java's behavior is, in other words, what you'd expect. In C, though, if you perform arithmetic on 32-bit floats you're actually performing 64-bit arithmetic on 64-bit intermediate results (at least most of the time; it's been a while since I consulted the rules). Java's behavior (which basically amounts to doing what you asked to do) infuriated the author, so he gave a bunch of examples of scientific calculations that need 64 bits of precision. But that's totally unconvincing to me: if you want 64-bit floating point precision, use doubles. C's implicit conversions in general have caused more harm than good and what the author is complaining about is having to tell the compiler to do 64-bit arithmetic on 32-bit values instead of having it follow complex promotion rules that few programmers even know about.
This was just tweeted by John Carmack (<a href="https://twitter.com/ID_AA_Carmack/status/392298557631254528" rel="nofollow">https://twitter.com/ID_AA_Carmack/status/392298557631254528</a>) which is probably why it was submitted.<p>It's pretty old, it should have a [1998] tag in the title in my opinion.<p>It's also pretty funny. :)
If 95% of programmers have misconceptions about floating point arithmetic, <i>we should stop using it as the default rational / real number type</i>. Floating point is a great optimization, but in a lot of situations it would be a lot better to have arbitrary-precision rational number types, continued fractions representations, or something else that better approximates what programmers expect.
What I found most interesting about the article was some of the mathematical techniques presented. See page 44 for an accurate formula for angular distances and page 48 ff. for an alternative formalism for the vector cross product.
Fully agree on the operator overloading complaint. It really is a LOT easier when working with matrices, vectors and scalars to be able to type their math expressions naturally rather than with functions like add(multiply(.....))
Another "everything Java does is evil" rant. No wonder HN is all over it. This is tiresome.<p>If you want 64 bit precision - use doubles. That's not hard, is it?