Re: POWER()

new topic     » goto parent     » topic index » view thread      » older message » newer message

>>It seems that power(x,2) is not quite right as far as speed.
>>It says in library.doc that powers of 2 are calculated very
>>efficiently.

>Didn't they mean power(2,x) ? :)


No, the example they gave was x*x
And RDS has optimized the 2^n type of expressions, prolly using
asm-shifting.
No calculation involved.

However, x*x can never be faster than power (x, 2) .. the preproccesor could
optimize for this ...

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu