r/programming • u/mttd • Aug 11 '26
Moving integer division to floating-point is trivial
https://marc-b-reynolds.github.io/math/2026/08/10/IntDivByFP.html
112
Upvotes
r/programming • u/mttd • Aug 11 '26
View all comments
Show parent comment
2
u/taw Aug 12 '26
The key part was "If your divisor doesn't change", so you only calculate this once ever, not for every number.
None of it works if you only divide once.