Abs Function

The ABS() abs() function returns the absolute value of a number. The abs(Integer) function returns the absolute value of the numeric argument. e.g. Abs(X) returns NULL if X is NULL. abs(X) return 0.0 if X is a string or blob that cannot be converted to a numeric value.

SELECT abs(5) /* returns 5 */;

SELECT abs(-5) /* returns 5 */;

SELECT abs('SQLDatabase.Net') /* returns 0 */;
    

If X is the integer -9223372036854775808 then abs(X) throws an integer overflow error since there is no equivalent positive 64-bit to complement value.