Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^5: A better rand() for Win32

by BrowserUk (Patriarch)
on Jul 31, 2007 at 01:22 UTC ( [id://629722]=note: print w/replies, xml ) Need Help??


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?


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://629722]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found