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. |
ABS(argument)
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
Statements | Results |
---|---|
x = abs(3.5) | // outputs 3.5 |
x = abs(-7) | // outputs 7 |
x = abs(-3*1.5) | // outputs 4.5 |
real seconds_diff
seconds_diff = abs((date1 - date2) * 86400)
// The number 86400 represents the total number of seconds in a day