Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: rand() precision low, looking for a fast way to get high precision rand float?

by bart (Canon)
on Oct 31, 2012 at 19:53 UTC ( #1001740=note: print w/replies, xml ) Need Help??


in reply to rand() precision low, looking for a fast way to get high precision rand float?

On Windows, the random number has only 15 bits. That means that if you multiply the results with 32768, the outcome will always be an integer.

If you want something better, at least in that regard, you could pick Math::Random::MT. It's pretty fast, too.

  • Comment on Re: rand() precision low, looking for a fast way to get high precision rand float?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001740]
help
Chatterbox?
[beech]: isn't 2 year about standard recovery time for that kind of surgery?
[Discipulus]: if you hate FIle::Find
[Lady_Aleena]: I don't hate it, it just drives me crazy.
[Discipulus]: LA the solution is portable to whatever
[Lady_Aleena]: File::Find doesn't have a simple sub wanted example, like get the name of the file.
[Discipulus]: there is also find2perl with your perl installation
[Discipulus]: and in the wanted sub you just calculate the duretion and add it the total, stop

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2017-04-23 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.