Caché MultiValue Basic Reference
PWR


Returns a number raised to a power.
Synopsis
Arguments
Description
The
PWR function raises
num to the power specified by
exponent. Both numeric values can be expressed as either numbers or as strings. Leading plus signs and leading and trailing zeros are ignored. A string is parsed as a number until a nonnumeric character is encountered. Thus “7dwarves” is parsed as 7. Nonnumeric strings and null strings are parsed as 0.
Any nonzero
num raised to an
exponent of 0 returns 1. If
num and
exponent are both 0,
PWR returns 0. If
num is 0 and
exponent is a negative number,
PWR generates an <ILLEGAL VALUE> error. If
num is a negative number and
exponent is a fractional number,
PWR generates an <ILLEGAL VALUE> error.
The same operation can be performed using the exponentiation operator: **. To perform exponentiation on the elements of a dynamic array, use the
PWRS function.
See Also
Copyright © 19972019 InterSystems Corporation, Cambridge, MA