numbers v5.0.0-rc0 Numbers.Helper

Summary

Functions

Performs ‘Exponentiation by Squaring’, which is a reasonably fast algorithm to compute integer powers, by performing log(n) multiplication steps

Functions

pow_by_sq(num, integer_power)

Performs ‘Exponentiation by Squaring’, which is a reasonably fast algorithm to compute integer powers, by performing log(n) multiplication steps.

Depends on an implementation existing of Numbers.Protocols.Multiplication, as well as (to support negative powers) an implementation of Numbers.Protocols.Division.