pow()

The mathLib.pow() system function returns a number raised to the power of a second number.
EGL maintains this function for compatibility with earlier versions. For new code, use the exponent operator (**, which translates as "to the power of"). See Operators and precedence. There are two minor differences between the function and the operator:

Syntax

  mathLib.pow(
    numericVariable1 FLOAT in,
    numericField2 FLOAT in)
  returns (result FLOAT)
numericVariable1
Input can be any variable or expression that is assignment compatible with the FLOAT type.
numericVariable2
Input can be any variable or expression that is assignment compatible with the FLOAT type.
result
The value of numericVariable1 to the power of numericVariable2 is returned as a FLOAT.

Example

  x INT = 2;
  y INT = 3;
  result = mathLib.pow(x,y);  // result = 8
  result = x**y;   // result = 8

Error conditions

EGL finds an error condition if, given pow(x,y), x is negative and y is not a whole number, or x is 0 and y is negative. The effect of the error condition depends on the value of the v60ExceptionCompatibility property; for more information, see EGL library mathLib.


Feedback