PWR


The PWR function raises a number to the n'th power.

 

COMMAND SYNTAX

PWR(expression1, expression2)

or

expression1 ^ expression2

 

SYNTAX ELEMENTS

Both expression1 and expression2 should evaluate to numeric arguments. The function will return the value of expression1 raised to the value of expression2.

 

NOTES

If expression1 is negative and expression2 is not an integer then a maths library error is displayed and the function returns the value 0. The error message displayed is:

pow: DOMAIN error

All calculations are performed at the maximum precision supported on the host machine and truncated to the compiled precision on completion.

 

EXAMPLES

A = 2
B = 31

CRT "2 GB is ":A^B

or

CRT "2 GB is":PWR(A,B)


jBC