Exponentiation (**)
The **
operator
calculates an exponentiation.
Syntax
num-expr ** int-expr
- num-expr is a numeric expression (real number).
- int-expr is the exponent, as a whole number.
Usage
The
**
operator returns a value calculated by raising the left-hand
operand to a power corresponding to the integer part of the right-hand
operand. n ** e = n * n * n ... (e times)
If the right operand (the exponent) is a number with a decimal part, it is rounded to a whole integer before computing the exponentiation.
If one of the operands is NULL
, the arithmetic expression evaluates to
NULL
.
Tip: The
**
operator takes an integer as exponent. If you need to raise
a number to an exponent that is a real number, use the fgl_decimal_power()
utility function.Example
MAIN
DISPLAY 2 ** 8
DISPLAY 10 ** 4
END MAIN