ABS (return absolute value)

Top  Previous  Next

 

ABS(expression)

ABS

Returns absolute value.

expression

A constant, variable, or expression.

The ABS procedure returns the absolute value of an expression. The absolute value of a number is always positive (or zero).

Return Data Type:

REAL or DECIMAL

Example:

C = ABS(A - B)              !C is absolute value of the difference

IF B < 0

B = ABS(B)                 !If b is negative make it positive

END

 

See Also:

BCD Operations and Procedures