Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: reliably test integer size for portable bit-fiddling? (~0)

by tye (Sage)
on Dec 10, 2014 at 15:34 UTC ( [id://1109925]=note: print w/replies, xml ) Need Help??


in reply to Re^3: reliably test integer size for portable bit-fiddling? (~0)
in thread reliably test integer size for portable bit-fiddling?

$ perl -le "print log(~0+1)/log(2)" 32

or, to be safe

$ perl -e 'printf "%.0f\n", log(~0+1)/log(2)' 32

- tye        

Log In?
Username:
Password:

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

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

    No recent polls found