Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: next power of two

by trizen (Friar)
on Dec 25, 2012 at 16:08 UTC ( #1010274=note: print w/ replies, xml ) Need Help??


in reply to Re^2: next power of two
in thread next power of two

...and here is the fastest :-)

sub next_power_of_two {2 << log($_[0]) / log(2)}


Comment on Re^3: next power of two
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-09-19 05:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls