
16 Jun
2011
16 Jun
'11
10:51 a.m.
Hi Roger,
Which is itself a square operation:
square (square a)
this is a special case of square-and-multiply or binary exponentiation (see http://en.wikipedia.org/wiki/Exponentiation_by_squaring) general square and multiply also works for an odd exponent and reduces the complexity from O(n) to O(log n) regards Matthias