Abs() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

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:

Sgn() function