Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: randfunc in Config

by BrowserUk (Patriarch)
on Jun 27, 2016 at 12:27 UTC ( [id://1166657]=note: print w/replies, xml ) Need Help??


in reply to Re^2: randfunc in Config
in thread randfunc in Config

Having a unified (drand48) rand() implementation is one of the features that came in with Perl 5.20.0, so testing in a sensible way for availability of drand48 (instead of testing for 5.20.0+)

Besides that 5.20+ seems like a far simpler criteria to test for; even if the goal is "any perl with drand48 even if that's a linux build before 5.20"; that still suggests that he is insisting on a 48-bit PRNG, which without knowing what the module is doing, seems short-sighted.

Ie. Why does it need to be 48-bit? How would the modules functionality be affected if I wanted to use the 32-bit MT? Or the 64-bit MT? Or even the very fast simd implementation of the 64-bit MT? What if I chose to provide a 48-bit PRNG that isn't the drand48 implementation?

If he needs that particular implementation, then seeding to a known seed and testing the first return value will detect it, both if it is under a different name; and perhaps more importantly, fail if it has the right name but the implementation has been screwed up.

But still the nagging in the back my head says that any algorithm that uses random numbers but needs one very specific PRNG to operate, is badly designed.

I can see that TDD proponents would like to be able to specify they PRNG because then all their little OK/NOK tests can compare against known pre-calculated outputs; but if that is the purpose; as soon as you've detected that you have the right PRNG, all those comparisons against pre-calculated outputs become redundant.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found