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

About 50x faster still :)

sub b{ my %s; keys %s = shift; undef $s{1}; substr %s, 1+index( %s,'/' ); }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: next power of two
by trizen (Hermit) on Dec 25, 2012 at 16:08 UTC
    ...and here is the fastest :-)

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