MathLib.abs function

MathLib.abs returns the absolute value of a number.

Package

eglx.lang

Syntax
	static function abs(value smallint in) returns(smallint);
	static function abs(value int in) returns(int);
	static function abs(value bigint in) returns(bigint);
	static function abs(value decimal in) returns(decimal);
	static function abs(value smallfloat in) returns(smallfloat);
	static function abs(value float in) returns(float);
value
Takes a numeric value.

The function returns a number that is of the same type as value.

Example use

After the following code runs, result is 5.0:

input, result SMALLFLOAT;
input = -5.00;
result = mathLib.abs(runningBalance);  // result = 5.0
Comments
In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.