Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Next section


Returns the absolute value of a number.




The number argument can be any valid numeric expression. If number is an uninitialized variable or a non-numeric value, Abs returns 0 (zero).


The absolute value of a number is its unsigned magnitude. For example, Abs(-1) and Abs(1) both return 1. Abs removes signs, and leading and trailing zeros from number.


The following example uses the Abs function to compute the absolute value of a number:

Println Abs(0050.300)  'Returns 50.3
Println Abs(-50.3)     'Returns 50.3
Println Abs(+50.3)     'Returns 50.3
Println Abs(0)         'Returns 0
Println Abs(-0)        'Returns 0
Copy code to clipboard

See Also

AscNext section