News for hackers. Stuff that matters.
Re:Faster remainders when the divisor is a constant: beating... by nitrogen on Friday February 08, 2019 @11:16PM (#19120691)
This is called reciprocal multiplication. You can trade off accuracy for number of bits required, etc. I used this to do meaningful processing of Kinect data on a CPU without an FPU at near full frame rate.

Just curious, did you try making x an 8-bit integer to see if the compiler chose a different multiplier?

Re:Faster remainders when the divisor is a constant: beating... by mark-r on Friday February 08, 2019 @11:31PM (#19120737)
No, I didn't try casting to char although I thought about it.