pow
host callCapy
function pow(base : f32, exponent : f32) f32 function pow(base : f64, exponent : f64) f64
Description
pow() follows the C pow rules: pow(0.0, 0.0) is 1.0, a negative base with a non-integral exponent yields NaN, and an overflow yields infinity. Integer exponents on integer values need a conversion: s64(pow(f64(n), 2.0)).
Parameters
base : the number to raise
exponent : the power, in the same type
Return Values
base raised to exponent, in their type.
Example
Capy
print(pow(2.0, 10.0), " ", pow(9.0, 0.5), " ", s64(pow(f64(3), 3.0)), "\n")
Output
1024 3 27