in reply to Re^4: A better rand() for Win32
in thread A better rand() for Win32
Agreed. It is pathetic that msvcrt is stuck with that prng. It's not even a good example of a 15-bit prng. It's almost worse that Perl hasn't corrected that deficiency. I guess it would just takes someone with the guts to work up the patch and champion it.
The MT consists of less that 80 lines of code, we could do worse than just use that everywhere. If there is concern that its 32-bit output would be a retrograde step for those that currently provide a 48-bit PRNG, there is now a 64-bit variant, which given the inexorable increase in 64-bit machines around, would seem to make sense, though it's not clear to me if that would compile on a 32-bit machine.
However, there is also a new, faster SIMD varient that is 2 - 4 times faster, produces 128-bit PRNs, has 64-bit, 32-bit and double output apis. I wonder if that would be portable enough for inclusion in perl?
|
|---|