What is the actual RNG that my compiler uses for the rand() function?

I have not been able to find the documentation for it. It always begins with this sequence when I do not seed it with time first.

41
18467
6334
26500
19169
15724
11478
29358
26962
24464
I don't know if it's defined in the standard, but most compilers use a linear congruential generator for rand().
but which LCG would yield the above sequence?
The Wikipedia article on LCGs has the generators for the most popular compilers. You could try each formula to see which one fits.
I don't see what could possibly be the use of doing this, though.
Moreover, the RNG that comes in the standard library is underpowered and not very balanced.
If you really want something nice, google around "mersenne twister".
Topic archived. No new replies allowed.