Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Exports functions involving integral powers.
Functions
- Iteratively generate sequential squares, from the specified initial value,
based on the fact that
(x + 1)^2 = x^2 + 2 * x + 1
. - The initial value doesn't need to be either positive or integral.
- Raise an arbitrary number to the specified positive integral power, using modular arithmetic.
- Implements exponentiation as a sequence of either squares or multiplications by the base; http://en.wikipedia.org/wiki/Exponentiation_by_squaring.
- http://en.wikipedia.org/wiki/Modular_exponentiation.