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.
|