3 ms·
I'm rather proud of Abseil's implementation: https://github.com/abseil/abseil-cpp/blob/887d0eee6bab35847253181b32e78ff707010ccd/absl/random/uniform_int_distribu
by ahh 6y ago
I'm rather proud of Abseil's implementation: https://github.com/abseil/abseil-cpp/blob/887d0eee6bab35847253181b32e78ff707010ccd/absl/random/uniform_int_distribution.h#L207 https://github.com/abseil/abseil-cpp/blob/887d0eee6bab358472...
As I recall another colleague wrote the original version (I do not remember who.) I bitbashed and optimized it, and added the comments, mainly because I wanted to make sure I understood the reasons it was right.
- deleted 6y ago[deleted]
- banachtarski 6y agoIt's uncanny but I literally looked at this an hour ago (prior to seeing this posting on HN). Thanks for the comments/annotation!