Oracle / PLSQL: LOG Function

This article is written about how to use the Oracle/PLSQL LOG function with syntax and examples.

Description

The Oracle/PLSQL LOG function returns the logarithm of n base m.

Syntax

The syntax for the LOG function in Oracle/PLSQL is:

LOG( m, n )

Parameters or Arguments

m

Value used in the calculation. It must be a positive number, except 0 or 1.

n

Value used in the calculation. It must be a positive number.

Returns

The LOG function returns a numeric value.

Applies To

The LOG function can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let’s look at some Oracle LOG function examples and explore how to use the LOG function in Oracle/PLSQL.

For example:

LOG(10, 20)
Result: 1.30102999566398

LOG(2, 15)
Result: 3.90689059560852

LOG(100, 1)
Result: 0