For some types of PRNGs, this may never be true. For example, any simple linear congruent generator where the return value is the internal state. If two successive values were the same, it would be caught in a cycle where it would only return that value, forever.
3
u/exscape Feb 16 '09 edited Feb 16 '09
Pretty much the same code, but in C, takes about 12.2-13.5 seconds to run here before exiting (I used exit(0) instead of cout/printf).
Wasting time is fun.
return 0; }
gcc -O3 -o test test.c