View Single Post
Old 11-11-2004, 11:22 PM   #7 (permalink)
archer
Upright
 
Location: Australia
Efficiency depends on the implementation of the power raising function.
This is generally done via logarithmic operations.
So for small powers like s^2 are done much more quickly as s*s, since this is a quicker operation in itself and saves the setup for a new method call.
Once you get into higher powers, it becomes much more efficient to use logarithms, and it gives you an easy way to calculate non-integer powers.
archer is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54