lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> yes (it uses the usual algorithm for integer powers, cumputing z^2,
> (z^2)^2, ((z^2)^2)^2 ... and multiplying the results; generally, all
> it's algorithms seem to be optimal)

Exponentiation by squaring is a good and popular algorithm and it
is optimal in the asymptotic sense, but it's not stricly optimal: