Raises a number to the power of another number.
# = x ^ y
# = Pow( x, y)
x,y | : aexp |
The result is number raised to the power of exponent, always as a Double value. The value of exponent can be fractional, negative, or both.
Global Single x, y
x = 2.2
y = 8.1
Debug x ^ y // prints 593.77775248624
Debug Pow(x, y) // prints 593.77775248624
Debug (y - 2 * x) ^ 4 // prints 187.416157967765
Debug.Show
Local a%, b%, c%, d%, y%, x%, e%
x% = 2, y% = 5
a% = x ^ y
b% = Pow(x, y)
c% = Exp(y * Log(x))
d% = Exp2(y * Log2(x))
e% = Exp10(y * Log10(x))
Debug a%, b%, c%, d%, e%
Debug.Show
When more than one exponentiation is performed in a single expression, the ^ operator is evaluated as it is encountered from left to right.
{Created by Sjouke Hamstra; Last updated: 15/01/2023 by James Gaite}