7 ms·
> [Fixed point arithmetic] has some niche uses but isn't commonly used It is very common in the embedded world and in hardware. I routinely program a CPU which
by colonwqbang 6y ago
> [Fixed point arithmetic] has some niche uses but isn't commonly used
It is very common in the embedded world and in hardware. I routinely program a CPU which has no FPU, so any arithmetic will have to be done in fixed point.
It's perfectly possible to get work done with fixed point arith, it just requires a bit more thinking through so you don't run out of bits. Usually, I write unit tests where I compile my code for host architecture and compare the fixed point result to host's floating point. Then I can set a precise error margin for my XP approximation.
- DoingIsLearning 6y agoAnother 'niche' use case is doing DSP calculations on an FPGA. If you can accept the trade-off of some degree of error with fixed-point, you can have very fast and heavily parallelized implementations.