News for hackers. Stuff that matters.
Re:Why floats suck - accurate galaxy-wide coordinates in 128... by cdavid on Monday May 02, 2011 @07:58PM (#2508416)
Floating point do not exist for performance optimization - they were much slower than fixed points at first (not anymore on general purpose CPU). The point of floating point is to have the same accuracy (number of meaningful digits) independently of its amplitude, but that means that their precision is indeed not uniform (near 1, 64 bits float has a precision of ~ 1e-16, near 100000, near 1e-11, etc...).

In that sense, saying that floating point suck shows a lack of knowledge about them, since the observed behavior by the OP is exactly what they have been designed for. If you want the same precision independently of the amplitude, then indeed fixed point may be what you want. But you have to keep in mind that it will give you a lot of other issues as well.

There are no comments on this comment yet.