3 ms·
I think this is a reasonable question if you don’t know the history or reasons, and there are some good answers here already. I’ll add that it’s worth reflectin
by dahart 4y ago
I think this is a reasonable question if you don’t know the history or reasons, and there are some good answers here already. I’ll add that it’s worth reflecting on the fact that floats are indeed a heavily used standard, so there’s another way to ask the question aside from starting with an assumption that fixed point is either better or easier: what advantages does a floating point number have above fixed point numbers? People do use both floats and fixed point numbers, so it’s not either-or, but I’m suggesting that to understand why floats are used so much, it would help to curate list of the reasons why floats are useful instead of focusing on reasons fixed points are useful.
The primary thing floats have that fixed point numbers don’t is the same relative precision regardless of magnitude. Combined with the ability to represent an enormous magnitude, and reasonably good precision near 0 and 1, this makes floats easier to use than fixed point numbers. With fixed point, you always have to think about the range and precision required, and with floats you don’t. Add in standards for representing Inf and NaN, which are pretty useful, and it’s easy to see why floats are quite popular.