RepeatedSquaring SΒΆ

defaults.spad line 1

Implements exponentiation by repeated squaring

expt: (S, PositiveInteger) -> S
expt(r, i) computes r^i by repeated squaring