LOG()

Overview

Returns the logarithm of a value in either base-e or a specified base.

USAGE

LOG(base, number)
LOG(number)

Argument Name

Description

number

The number to transform

base

Optional. The logarithmic base to use

DETAILS

LOG() is a mathematical function that returns a value's logarithm in the requested base:

  • When two arguments are provided, the logarithm returned is computed using the specified base

  • When one argument is provided, LOG() works like LN() and returns a natural logarithm

LOG() returns a value with a DOUBLE data type. If the argument value or the computed value exceeds DOUBLE precision, an error is returned.

A NULL is returned if either argument is NULL or the number argument is less than or equal to zero.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT LOG(10, 10), LOG(1);
+-------------+--------+
| LOG(10, 10) | LOG(1) |
+-------------+--------+
|           1 |      0 |
+-------------+--------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES