ABS()

ABS(), ABSS()

Top  Previous  Next

 

The ABS() function returns the absolute (positive) value of a numeric expression.

 

The ABSS() function is similar to ABS() but operates on successive elements of a dynamic array, returning a similarly structured dynamic array of results.

 

 

Format

 

ABS(expr)

 

where

 

exprevaluates to a number or a numeric array.

 

 

The ABS() function returns the absolute value of expr. If expr is positive or zero, the value of ABS(expr) is expr. If expr is negative, the value of ABS(expr) is -expr.

 

If expr is a numeric array (a dynamic array where all elements are numeric), the ABS() function operates on each element in turn and returns a numeric array with the same structure as expr.

 

 

Examples

 

DIFF = ABS(A - B)

 

This statement assigns DIFF to the difference in value of A and B. The result is positive regardless of which value is the greater.

 

 

A contains  11FM-2VM-8VM4

B = ABSS(A)

B now contains  11FM2VM8VM4