Purpose
Returns the absolute value of a number. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Abs ( num_expr )
num_expr is a numeric expression.
Return Value
Float
Description
The Abs() function returns the absolute value of the expression specified by num_expr.
If num_expr has a value greater than or equal to zero, Abs() returns a value equal to num_expr. If num_expr has a negative value, Abs() returns a value equal to the value of num_expr multiplied by negative one (-1).
Example
Dim f_x, f_y As Float
f_x = -2.5
f_y = Abs(f_x)
' f_y now equals 2.5
See Also: