Lol, I wrote this thread from a mobile device, so I was trying to avoid too many lines. Since you guys are so picky about something pointless I'll change it lmao.
/*
This forum contains a lot of oversensitive pedants that will
bicker about anything. The Lounge is a toilet. C++
is a hodgepodge of bolted-on feature sets inspired by better
languages. Every time you post template code in the beginner's
forum, a child in the world is starved on purpose. Torvalds
was right about C++, and he is smarter than all of you.
*/
int main() { return 0; }
That's a shame. I was hoping each version would check the same division on the same numbers when given the same seed (why don't they?). Apparently there is variance (depending on your system?), which I didn't expect.
rand() almost always uses linear congruental generator. Next number is calculated as xn = (axn-1 + c) % m. Values of a, c and m can vary depending on implementation. I just created an instance of LCG explicitly using constants from Microsoft Standard C Library.
MS version of C standard library is unique that it returns not least significant bits (usually 0-31 or 0-15) but most significant (starting with 16th). So I had to right shift result to get exact values.