02-23-2024, 04:57 PM
Hi!
That's the reason, it's fixed point math. On low-end hardware, integer math is much faster than floating point. So the fractional accumulation is done in 16.16 fixed point, that is 16 bits for integer part, and another 16 bits for decimal part.
However I'll check it, as I would rather write "(offset >> FIXED_BITS)" than "offset / (1 << FIXED_BITS)". This piece of code is quite old and I may be missing something right now
That's the reason, it's fixed point math. On low-end hardware, integer math is much faster than floating point. So the fractional accumulation is done in 16.16 fixed point, that is 16 bits for integer part, and another 16 bits for decimal part.
However I'll check it, as I would rather write "(offset >> FIXED_BITS)" than "offset / (1 << FIXED_BITS)". This piece of code is quite old and I may be missing something right now