Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: how to get a 64bit random number with rand() ?

by Tux (Canon)
on Mar 21, 2018 at 15:02 UTC ( #1211430=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Hexadecimal number > 0xffffffff non-portable at test.pl line 9
    
  2. or download this
    $ perl -V:ivsize
    ivsize='8';
    ...
    1152921504606846975
    $ perl -wle'printf "%x\n", 1152921504606846975'
    fffffffffffffff
    
  3. or download this
    $ gperl32 -V:ivsize
    ivsize='4';
    ...
    1.15292150460685e+18
    $ gperl32 -wle'printf "%x\n", 1152921504606846975'
    ffffffff
    
  4. or download this
    use 5.18.2;
    use warnings;
    ...
        my $n = unpack "Q>", pack "L>L>", $n1, $n2;
        printf "\r%064b %016X\n", $n, $n;
        }
    
  5. or download this
    One rand
    0000000001011110010111000001101110010101000100000000111111111111 005E5
    +C1B95100FFF
    ...
    1000010010001000100101101000000010100011000000111111100011010100 84889
    +680A303F8D4
    1001011101011111101000010100010000010010111010111000100010110010 975FA
    +14412EB88B2
    1001001001001110111101001100000001101010000011110110101100110110 924EF
    +4C06A0F6B36
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2022-05-19 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?