totn MariaDB Functions

MariaDB: LN Function

This MariaDB tutorial explains how to use the MariaDB LN function with syntax and examples.

Description

The MariaDB LN function returns the natural logarithm of a number.

Syntax

The syntax for the LN function in MariaDB is:

LN( number )

Parameters or Arguments

number
The number to calculate the natural logarithm of. Must be greater than 0.

Note

  • The LN function will return NULL, if number is less than or equal to 0.
  • See also the LOG and EXP functions.

Applies To

The LN function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB LN function examples and explore how to use the LN function in MariaDB.

For example:

SELECT LN(2);
Result: 0.6931471805599453

SELECT LN(1.5);
Result: 0.4054651081081644

SELECT LN(0);
Result: NULL

SELECT LN(-1);
Result: NULL