3 ms·
This is a complete fallacy. Just because output and input accuracy are low, that does not imply that intermediate accuracy can be low too. You gave the example
by constantcrying 4y ago
This is a complete fallacy. Just because output and input accuracy are low, that does not imply that intermediate accuracy can be low too.
You gave the example of a milling machine, of course in most cases you wouldn't expect it to be accurate to more then a 10th of milliliter. So you could believe that e.g. 100th of a millimeter should be more then enough as your scaled integer (meaning an integer with a value of "100" represents one millimeter). The maximum value of a 32bit integer would represent around 43km. Who would ever want to use more?
But what if now you are trying to calculate the 3D distance between two points which are about a meter (= 1000mm = (int)100000) apart in one direction. To calculate this you need a third power. 100000^3 is pretty large, much larger than a 32 bit int can hold...oops
With scaled integers you have to constantly think about whether each intermediate result is still within your range. It is a terrible, headache inducing format for many applications. The magic of floats is that you do not need to worry about so many things.
Yes, they have their pitfalls, but they are used for a very good reason and "you don't need the precision" simply is false in many cases.