Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by Tux (Canon)
on Mar 21, 2018 at 15:02 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found