PWR

PWR


PROMPT Index Level quotes
Syntax PWR( num.expression, power.expression )
Category BASIC
Type Function
Description raises a value contained in an expression to the power of the value of a second expression.

A "power.expression" of 0 (zero) always returns a "1" (one). A "num.expression" of 0 (zero) returns zero.
Options
See Also ^ statements & functions functions
Example print pwr(3,2)

This statement prints a 9, the result of 3 taken to the power of 2.

print 3^2

In this statement "3^2" is identical to pwr(3,2).

print pwr(xyz,.5)

This prints the square root of the value stored in the variable "xyz". This is equivalent to:

print sqrt(xyz)
Warnings As with all functions which require numeric expressions, if any of the arguments evaluates to something other than a numeric, the following runtime warning message is displayed:

[b16] in program "pgm", line n:  Non-numeric data when numeric required; zero used.
Compatibility D3 7.0 AP R83
PROMPT Index Level quotes