Exponentiation operator (LotusScript® Language)

Raises a number to a power.

Syntax

number ^ exponent

Elements

number

Any numeric expression.

exponent

Any numeric expression. If number is negative, exponent must be an integer value.

Return value

The resulting data type is a Double or a Variant of type Double.

If either or both operands are NULL expressions, the result is a NULL.

Usage

Multiple ^ operators in a single expression are evaluated from left to right.

Example

Print 4 ^ 3       ' Prints 64
Print 4.5 ^ 3     ' Prints 91.125
Print -2 ^ 3      ' Prints -8
Print 2 ^ 3 ^ 2   ' Prints 64
' Use parentheses to change order of evaluation.
Print 2 ^ (3 ^ 2) ' Prints 512