contents.gifindex.gifprev1.gifnext1.gif

^ Operator

Purpose

Used to raise a number to the power of an exponent.

Syntax

result = number ^ exponent

Notes

The number and exponent operands can be any numeric expression. However, the number operand 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.

Usually, the data type of result is a Double or a Variant (VarType 5). However, if either number or exponent is a Null expression, result is also a Null.

Example

This example returns 256 by raising 2 to the eighth power.

X = 2 ^ 8