Operators

^

Supported By

Syntax

expression ^ expression

Each expression yields an integer, a number, or a complex.

Description

The ^ operator evaluates to the exponentiation of the given values.

Notes

If either given value is a complex, the evaluated value will be a complex. Otherwise, the evaluated value will be a number.

The ^ operator has mathematically correct associativity but mathematically incorrect precedence. For example: The expression 2^3^2 will evaluate to the mathematically correct 512 (2^(3^2)) rather than the mathematically incorrect 64 ((2^3)^2). However, the expression -2^2 will evaluate to the mathematically incorrect 4 ((-2)^2) rather than the mathematically correct -4 (-(2^2)).

Synonym

**

See Also

pow