Keep It Simple, Stupid | |
PerlMonks |
Re^5: A better rand() for Win32by BrowserUk (Patriarch) |
on Jul 31, 2007 at 01:22 UTC ( [id://629722]=note: print w/replies, xml ) | Need Help?? |
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? Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Code Catacombs
|
|