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
33
u/Dwedit Aug 11 '26
If your divisor doesn't change, use integer multiplication by reciprocal, also shift or discard from the high result.