Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Convert unsigned long int (64bit) to binary string(64bits)

by taint (Chaplain)
on Dec 13, 2013 at 07:39 UTC ( #1066994=note: print w/ replies, xml ) Need Help??


in reply to Convert unsigned long int (64bit) to binary string(64bits)

I get the same results as hdb.

My Perl is 64bit, and I'm on a *BSD box -- pertinent bits from perl -V: use64bitint=define, use64bitall=define USE_64_BIT_ALL

print unpack( "b64", pack( "Q", 4_294_967_295)), "\n"; print unpack( "b64", pack( "Q", 126_294_967_295)), "\n"; print unpack( "b64", pack( "Q", 4294967295)), "\n"; 1111111111111111111111111111111100000000000000000000000000000000 1111111111000010001000111110011010111000000000000000000000000000 1111111111111111111111111111111100000000000000000000000000000000

--Chris

EDIT: I might add, it's a 6core AMD CPU (AM2 I think)
Yes. What say about me, is true.


Comment on Re: Convert unsigned long int (64bit) to binary string(64bits)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-12-26 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (174 votes), past polls