ABS Function

Returns the absolute value of a number.

Category: Mathematical
Returned data type: Real
Note: The ABS function returns a nonnegative number that is equal in magnitude to the magnitude of the argument.

Syntax

ABS(argument)

Required Arguments

argument

a real that can be specified as a numeric constant, field name, or expression

returns

a real that represents the absolute value of the argument

Examples

Example 1
Statements Results
x = abs(3.5) // outputs 3.5
x = abs(-7) // outputs 7
x = abs(-3*1.5) // outputs 4.5
Example 2

real seconds_diff

seconds_diff = abs((date1 - date2) * 86400)

// The number 86400 represents the total number of seconds in a day