w3resource

PostgreSQL LN() function

LN() function

The PostgreSQL LN() function is used to return the natural logarithm of a given number, as specified in the argument. The natural logarithm is the logarithm to the base e, where e is approximately equal to 2.71828.

Uses of LN() Function
  • Mathematical Calculations: To perform natural logarithmic calculations in mathematical formulas.

  • Scientific Research: Useful in scientific research and computations involving logarithmic functions.

  • Financial Analysis: To calculate continuous compounding interest and other financial models requiring natural logarithms.

  • Data Analysis: In statistical and data analysis where natural logarithms are needed to model data trends and transformations.

Syntax:

ln()

PostgreSQL Version: 9.3

Pictorial presentation of PostgreSQL LN() function

pictorial presentation of PostgreSQL LN() function

Example: PostgreSQL LN() function:

Code:

SELECT LN(3.0) AS "Natural Logarithm";

Sample Output:

  Natural Logarithm
--------------------
 1.0986122886681097
(1 row)

Previous: FLOOR function
Next: LOG function



Follow us on Facebook and Twitter for latest update.