- Function Power(x, y)
Power
Power(
x, ! (input) numerical expression
y ! (input) numerical expression
)
Arguments
- x
A scalar numerical expression.
- y
A scalar numerical expression.
Return Value
The function
Power
returns \(x\) raised to the power \(y\).
Example
_p_returnA := power( 8, 3 ); ! power( 8, 3 ) = 512
_p_returnB := power( 8,-3 ); ! power( 8,-3 ) = 0.001953125000
_p_returnC := power(-8, 3 ); ! power(-8, 3 ) = -512
_p_returnD := power(-8,-3 ); ! power(-8,-3 ) = -0.001953125000
Note
The following combination of arguments is allowed:
\(x > 0\)
\(x = 0\) and \(y > 0\)
\(x < 0\) and \(y\) integer
In all other cases a run-time error will result.
The function can be used in constraints of nonlinear mathematical programs.
See also
Arithmetic functions are discussed in full detail in Arithmetic Functions of the Language Reference.