Description

The Abs function returns the absolute value of the expression. The absolute value of a real number is its distance from 0 (zero) without regard to direction from zero. Use the Abs function to convert a negative number to a positive number.

Syntax

value = Abs(expression)

See also

Neg()

Example

/* Assigns the value 100 to absolute_value. */
absolute_value = Abs(-100)
 
/* Assigns the value 300 to the variable B.  */
A = 500
B = Abs(A - 800)
 
/* Assigns the value 0 to the variable C.  */
C = Abs(0)
  • No labels