math.pow
math.pow(base, exponent)
Description
Returns the value of the first arg raised to the power of the second arg. Returns 0 in case of overflow.
Param data types
base: INT|FLOAT
exponent: INT|FLOAT
Return type
FLOAT
Code samples
Example 1
This example shows an integer case.
math.pow(2, 2) // 4.00
Example 2
This example shows a fraction base case.
math.pow(2.200000, 3) // 10.648
Example 3
This example shows a fraction base and power case.
math.pow(2.200000, 1.200000) // 2.575771
Example 4
This example shows a negative power case.
math.pow(3, 0-3) // 0.037037
Example 5
This example shows a fraction power case.
math.pow(3, 0-1.200000) // 0.267581
Example 6
This example shows a negative base case.
math.pow(0-3, 0-3) // -0.037037
Example 7
This example shows a zero base case.
math.pow(0, 3) // 0
Example 8
This example shows a zero power case.
math.pow(9223372036854775807, 0) // 1
Example 9
This example shows a large base case.
math.pow(9223372036854775807, 1.200000) // 57262152889751593549824