Operator ** Foundation
Exponential operator (binary): exponentiation of a numeric value.
Syntax
<nValue> ** <nExponent> // or
<nValue> ^ <nExponent>
Parameters
<nValue>
<nValue> is a numeric expression whose value is to be raised exponentially (to the specified power).
<nExponent>
<nExponent> is a numeric expression for the power (exponent) to which <nValue> is raised.
Description
The exponential operator determines the value of <nValue> raised to the power of <nExponent> and returns the result of the operation as a numeric value.
Examples
// This example shows various results of the exponentiation operator.
PROCEDURE Main
SET DECIMALS TO 6
SET FIXED ON
? 1 ** -3 // result: 1.000000
? 2 ** -2 // result: 0.250000
? 9 ** -2 // result: 0.012346
? 2 ** 0 // result: 1.000000
? 10 ** 1 // result: 10.000000
? -10 ^ 2 // result: 100.000000
? -10 ^ 3 // result: -1000.000000
? -2 ** 10 // result: 1024.000000
? -16 ^ 0 // result: 1.000000
? 16 ^ 2 // result: 256.000000
? -16 ^ 4 // result: 65536.000000
RETURN
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.