Caché Basic Reference
Exponent Operator (^)


Used to raise a number to the power of an exponent.
Synopsis
result = number ^ exponent
Arguments
Description
The caret (^) is used as the exponentiation operator.
Note:
The exponent operator should not be confused with the base10 exponent symbol. An uppercase letter “E”, or lowercase letter “e” can be used as a base10 exponent (scientific notation) symbol in a numeric literal. These letters cannot be used as operators.
The
number argument can be negative only if
exponent is an integer value. When more than one exponentiation is performed in a single expression, the ^ operator is evaluated as it is encountered from left to right.
Example
The following example shows valid uses of the exponent operator (^) and the base10 exponent symbol (E). Note that the usage
x E y is not valid, because E is a numeric literal character, not an operator.
SET x=3
SET y=4
Println x ^ y ' Returns 81
Println 3E4 ' Returns 30000
See Also