Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

(MeowChow) Re: perl rand() function

by MeowChow (Vicar)
on Apr 16, 2002 at 10:46 UTC ( [id://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

Replies are listed 'Best First'.
(tye)Re: perl rand() function
by tye (Sage) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://159449]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found