Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(MeowChow) Re: perl rand() function

by MeowChow (Vicar)
on Apr 16, 2002 at 10:46 UTC ( #159449=note: print w/ replies, xml ) Need Help??


in reply to perl rand() function

Yes, it is zero inclusive, however, I wouldn't be waiting around for perl -e '1 while rand' to finish within my lifetime.

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on (MeowChow) Re: perl rand() function
Download Code
(tye)Re: perl rand() function
by tye (Cardinal) on Apr 16, 2002 at 15:02 UTC

    I'm so sorry that MeowChow was diagnosed as terminally ill with less than 1 second expected to live! I'm just glad the submit button got pressed before the end.

    % perl -de 0 ... DB<1> $c=0; print ''.localtime(),$/; $c++ while rand; print ''.local +time(),$",$c,$/ Tue Apr 16 07:57:24 2002 Tue Apr 16 07:57:24 2002 55285 DB<2> $c=0; print ''.localtime(),$/; $c++ while rand; print ''.local +time(),$",$c,$/ Tue Apr 16 07:57:28 2002 Tue Apr 16 07:57:28 2002 82230
    ;)

    Update: To be more informative rather than just humorous, I'll note that     perl -MConfig -e 'print $Config{randbits}'
    reports 15 for me. If I managed to build Perl such that this value got all the way up to 32, then I'd project MeowChow's life expectancy at a bit under 45 minutes. If I got that up to 48, then we'd be talking closer to 5 years. And if I got it up to 64, then I'd agree with MeowChow that waiting around 350,000 years wasn't worthwhile. (:

            - tye (no, I don't own a Cray)
      tye, you absolutely slay me :)
         MeowChow                                   
                     s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-29 06:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls