kayws426 / embox

Automatically exported from code.google.com/p/embox
0 stars 1 forks source link

rand and random RAND_MAXes are different #701

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. rand:  seed = (unsigned int)(seed * 16546134871 + 513585871) % (204814687)
2. random: val = ((state[0] * 1103515245) + 12345) & 0x7fffffff

What is the expected output? What do you see instead?
RAND_MAXes are different. RNG could perform poorly

Please use labels and text to provide additional information.

Original issue reported on code.google.com by drakon.m...@gmail.com on 20 Aug 2014 at 2:30