^

Typeoperator
DictionaryLCS
LibraryLiveCode Script
Syntax
<number> ^ <exponent>
Summary

Raises a number to a power.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
number

The number and exponent are numbers, or expressions that evaluate to numbers.

exponent
Example
7^3
myNumber^(1/2)
put 2^bitDepth into numberOfColors
Values
NameTypeDescription
The result

If the exponent is zero, the result of this operator is 1, regardless of what the number is.

RelatedFunction: ln1, exp, sqrt
Glossary: operator, operation, math operation
Description

Use the ^ operator to raise a number to a power, or to find a root of a number.

If the exponent is a fraction, with 1 as the numerator, the ^ operator finds the specified root of the number. For example, if the exponent is 1/2, the operation yields the square root of number; if the exponent is 1/4, the operation yields the 4th root of the number, and so on.

If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.

Tagsmath