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
19
u/Dragdu Aug 11 '26
Only if the divisor is real constant, but not if divisor is constant adjacent (think function with the signature of
divide_all_by(std::span<uint> in, uint divisor)), they won't and you have to use libdivide.