mathLib.abs

The system function mathLib.abs returns the absolute value of a number.


sysLib.abs syntax diagram

result

Any numeric or HEX item, as described in Mathematical (system words). The absolute value of numericItem is converted to the format of result and returned in result.

numericItem

Any numeric item or HEX item, as described in Mathematical (system words).

mathLib.abs works on every target system. In relation to Java programs, EGL uses one of the abs() methods in the Java StrictMath class so that the run-time behavior is the same for every Java Virtual Machine.

Example

  myItem = -5;
  result = mathLib.abs(myItem);  // result = 5

Related reference
Mathematical (system words)