Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Bitwise & with large numbers

by dcd (Scribe)
on Apr 04, 2002 at 02:08 UTC ( [id://156537]=note: print w/replies, xml ) Need Help??


in reply to Bitwise & with large numbers

Others have given explanation, but I thought that I'd add that Math::BigInt will give the answer that you desire
perl -MMath::BigInt -le ' $i=new Math::BigInt "4294967296"; $j=new Math::BigInt "4294967295"; print $i->as_hex(); print $j->as_hex(); print $i->band($j)->as_hex()'
0x100000000 0xffffffff 0x0

Log In?
Username:
Password:

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

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

    No recent polls found