2 ms·
You are correct that for a lot of use-cases, a fixed point format would be better. However fixed point is, as already noted, fundamentally just integer operati
by magicalhippo 4y ago
You are correct that for a lot of use-cases, a fixed point format would be better.
However fixed point is, as already noted, fundamentally just integer operations so there's nothing holding you back.
Language support can make it somewhat easier though, like templates in C++ can make arbitrary fixed points ergonomic, or in Delphi which has a "native" currency type which is a 64bit integer with a multiplier of 1000 (four decimal digits).
For arbitrary real-number operations that you find in more general physics and statistics, you need something more though as the scaling factor needed can depend on the input values.