Power ( ** )
- Last UpdatedJul 13, 2021
- 1 minute read
The Power operator returns the result of a number (the base) raised to the power of a second number (the power). The base and the power can be any real or integer numbers, subject to the following restrictions:
-
A zero base and a negative power are invalid.
Example: "0 ** - 2" and "0 ** -2.5"
-
A negative base and a fractional power are invalid.
Example: "-2 ** 2.5" and "-2 ** -2.5"
-
Invalid operands yield a zero result.
The result of the operation cannot be so large or so small that it cannot be represented as a real number. Example:
1 ** 1 = 1.0
3 ** 2 = 9.0
10 ** 5 = 100,000.0