Re:Faster remainders when the divisor is a constant: beating...
by saagarjha on Saturday February 09, 2019 @04:13AM
(#19121461)
This was exactly what I was about to mention; I can reproduce your results in Clang but it seems GCC doesn't want to optimize this? Here's what Godbolt gives me: https://godbolt.org/z/aFTdur
[ Parent
| on HN ]
Re:Faster remainders when the divisor is a constant: beating...
by acqq on Saturday February 09, 2019 @10:24AM
(#19122696)
Just write a function “mydiv10” which returns if x < 99 { x /10 and 0 otherwise and try again.