We’re rewarding the question askers & reputations are being recalculated! Read more.
1 of 4

Your argumentation against floating point numbers is very fragile, probably because of naivety. (No offense here, I find your question is actually very interesting, I hope my answer will also be.)

A classic argument is that floats provide a greater range, but high precision integers can meet this challenge now. For example: with modern 64-bit processors, we can do fast integer calculations up to 2^64. The solar system is a little less than 10 billion km in width. 10 billion km divided by 2^64 is about 5 microns. Isn't being able to represent position within the solar system to the precision of half a human hair enough?

You seem to do an implicit statement, according to which once I know the scale of my problem I can use fixed point arithmetic with respect to this scale to solve my problem.

Sometimes, this is a valid approach, and this is the one choosed by Knuth to implement distance computations in TeX. What makes the use of fixed point arithmetic pertinent in this case is that all quantities appearing within a computation are integers or distances occuring in a typesetting problem. Because the field of applications is so narrow, it makes sense to choose a very small unit length—much smaller than what the human eye can perceive—and convert all quantities into multiples of this unit. A very important remark, is that in the typograhical problems relying on this representation of numbers, we never need to multiply two lengthes together.

Most of the times, it is however a terrible approach, here are the reasons why:

  1. There exists physical constants and you cannot always adapt their units in a sensible way.

    Consider your solar system setting. The gravitational constant is 6.67×10−11 N·(m/kg)2, the speed of light is 3.00x10+5 m/s, the mass of the Sun is 1.9891×10+30 kg and the mass of the Earth is 5.97219×10+24. In your fixed point setting, you will not be able to represent the gravitational constant to a satisfying precision. So you will change the unit. But by doing so, you have to replace each number—replacing well-known, familiar quantities, by cryptic values. Furthermore, it is very likely that finding an appropriate system is not even possible (think to quantum physicits working with the lightspeed fast infinitely small particles).

  2. There exists mathematical unitless constants.

    The value of Pi is 3.1415 without any unit attached. There is actually a lot of similar useful constants that cannot be accurately represented in an arbitrary fixed point system. In your solar system setting, you can represent Pi with 6 decimal places, which give a terrible accuracy when computing the circumference of an orbit, for instance.

  3. In a fixed point system, you need to know in advance the size of the quantity you are computing.

    Say you do not know the value of the gravitational constant. You make a lot of measures, plug everything in the computer and… tada! You get a zero!

  4. Some mathematical functions will not work well with fixed precision arithmetic, because of their growth. Basically the exponential and the gamma function, for the most important ones.

  5. In fixed point arithmetic, it is very hard to multiply and divide numbers correctly, because if you do not know the size of the numbers, you cannot tell if their product is representable or not—leading to large numerical errors.


While your conclusion imply that fixed point arithmetic could be sufficient for all-purpose computations and that floating point arithmetic should be reserved to supercalculators, it is precisely the converse that is true: floating point arithmetic is a very good and very sensible tool for all-purpose computations, while fixed point will only do well in very specific, well analysed, cases.