Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: inclusive randby BrowserUk (Patriarch) |
on Mar 13, 2017 at 13:48 UTC ( [id://1184422]=note: print w/replies, xml ) | Need Help?? |
If you multiply rand by 101, int it, then divide by 100, you'll get all possible (2-decimal place) values between 0 and 1 inclusive with 'equal probability': <Reveal this spoiler or all in this thread>
If you need 3 decimal places, use int( rand *1001 )/1000; and for 4: int( rand * 10001 )/10000 etc. (But beware the number of bits available in the rand() you use. On Windows, pre-5.20something, perl's rand() only has 15-bits. ) 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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|