Re:C++ proposal: There are 8 bits in a byte
by tntxtnt on Friday October 18, 2024 @11:36AM
(#41880390)
RAND_MAX is only guaranteed to be at least 32767. So if you use `rand() % 10000` you'll have real biased towards 0-2767, even `rand() % 1000` is already not uniform (biased towards 0-767). And that assumes rand() is good uniform from 0-RAND_MAX in the first place.
[ Parent
| on HN ]
There are no comments on this comment yet.