News for hackers. Stuff that matters.
Re:A fast alternative to the modulo reduction (2016) by ThJ on Sunday October 06, 2019 @07:17PM (#21175901)
As far as I can tell, this is basically the 32.32 fixed-point equivalent of Math.floor(N * Math.random()).

It reminds me of the sort of tricks I used as a teenager back in the 90s to speed up my MS-DOS graphics code.

Another trick: You can perform rounding by adding fixed-point 1/2 before the bit shift.

Re:A fast alternative to the modulo reduction (2016) by nullc on Monday October 07, 2019 @03:03AM (#21178187)
> As far as I can tell, this is basically the 32.32 fixed-point

That's exactly how I described this trick in code-comments.