Cldr.Math.power
You're seeing just the function
power
, go back to Cldr.Math module for more information.
Specs
power(number_or_decimal(), number_or_decimal()) :: number_or_decimal()
Raises a number to a integer power.
Raises a number to a power using the the binary method. There is one
exception for Decimal numbers that raise 10
to some power. In this case the
power is calculated by shifting the Decimal exponent which is quite efficient.
For further reading see this article
This function works only with integer exponents!
Examples
iex> Cldr.Math.power(10, 2)
100
iex> Cldr.Math.power(10, 3)
1000
iex> Cldr.Math.power(10, 4)
10000
iex> Cldr.Math.power(2, 10)
1024