Mega Code Archive

 
Categories / MySQL Tutorial / Math Numeric Functions
 

LN(X) returns the natural logarithm of X; that is, the base-e logarithm of X

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