Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: A better rand() for Win32

by ysth (Canon)
on Jul 31, 2007 at 01:01 UTC ( [id://629718]=note: print w/replies, xml ) Need Help??


in reply to Re^3: A better rand() for Win32
in thread A better rand() for Win32

Thanks for expanding on your comment. One of these days, I'm hoping somebody drops a real PRNG into the perl core for use on platforms where $Config{randbits} < 48 (msvcrt is 15 :( ).

Replies are listed 'Best First'.
Re^5: A better rand() for Win32
by BrowserUk (Patriarch) on Jul 31, 2007 at 01:22 UTC

    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://629718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-20 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found