ABS Function

Generate the absolute (positive) numeric value of an expression.

Syntax

ABS(expression)

Syntax Elements

expression An expression that evaluates to a numeric value.

Examples

A = 100
B = 25
C = ABS(B-A)

Assigns the value 75 to variable C.

A = ABS(Q)

Assigns the absolute value of variable Q to variable A.

X = 600
Y = ABS(X-1000)

Assigns the value 400 to variable Y.

X = -10
Y = ABS(X)

Assigns the value 10 to variable Y.