On 07 Feb, Rowel Atienza ([EMAIL PROTECTED]) said:

> > i know this has already been way off topic :) but exponentiation with an
> > integer exponent and base 2 is easier done by having bit shifts <<
> but bit shift << consumes much less cpu cycles than
> exponentiation of 2 to an int.

That is true, especially since exponentiation in this case involves not
only multiplication but also floating point operations. Even optimized
exponentiations are more expensive than bit shifts - if only because bit
shifts are really easy to do in hardware and have their own opcodes
already, while exponentiation requires some multiplication...

(See, I knew that computer architecture class would come in handy...)

Lies, damned lies, and statistics. ;)

-- 
Sacha Chua <[EMAIL PROTECTED]>                       3 BS CS geek =)
Ateneo Cervini-Eliazo Networks (ACENT) tel: 63(2) 426-6001 loc 5925
BOFH excuse #250: Program load too heavy for processor to lift.
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to