mysql.h


ABS

ABS(X)

Devuelve el valor absoluto de X:

mysql> SELECT ABS(2);
+--------+
| ABS(2) |
+--------+
|      2 |
+--------+
1 row in set (0.00 sec)

mysql> SELECT ABS(-32);
+----------+
| ABS(-32) |
+----------+
|       32 |
+----------+
1 row in set (0.00 sec)

Esta función es segura con valores BIGINT.