r/programming • • 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

34 comments sorted by

View all comments

Show parent comment

3

u/Madsy9 Aug 11 '26

a/b = a*(1/b). If b is constant, just compute its reciprocal. If 1/b is a fraction, do the multiplication in fixedpoint.