MySQL LN() Function
In MySQL, the LN()
function returns the natural logarithm of the specified number.
LN()
Syntax
Here is the syntax of MySQL LN()
function:
LN(number)
The LN(number)
function is the same as the LOG(number)
function.
Parameters
number
- Required. A number. The value must be greater than
0
.
Return value
In MySQL, the LN()
function returns the natural logarithm of the specified number.
- If
number
is less than or equal to0
, the function will returnNULL
. - If
number
isNULL
, the function will returnNULL
.
LN()
Examples
SELECT
LN(1),
LN(2),
LN(0),
LN(-1),
LN(NULL)\G
output
*************************** 1\. row ***************************
LN(1): 0
LN(2): 0.6931471805599453
LN(0): NULL
LN(-1): NULL
LN(NULL): NULL