Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Power of two round up.

by Dominus (Parson)
on Dec 17, 2000 at 05:35 UTC ( #47091=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Power of two round up.
in thread Power of two round up.

Sure, because it has to dispatch many fewer opcodes. But if I had wanted to use the log2 x solution, I wouldn't have asked in the first place. Floating-point arithmetic gives me the heebie-jeebies.

Replies are listed 'Best First'.
Re: Re: Power of two round up.
by I0 (Priest) on Dec 18, 2000 at 22:44 UTC
    Floating-point gives me heebie-jeebies too. (in fact, a floating conversion seems to be what makes the |>> method fail for @_ = (0)
    --then again, log(0) doesn't work either, and the |>> method does work for @_=(0) if you use integer;)
    P.S. Why does an opcode fetch take longer than a transcendental function? I'm sure that part of the interpreter must have been fully optimized.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2016-10-23 12:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (301 votes). Check out past polls.