ln function

The ln function returns the natural logarithmic value (base e) of the specified expression.

Syntax:

double ln(n)

Semantics:

  • n: The argument n is an expression that resolves to a number.
  • return type: double.
    • Returns a NULL value in the following cases:
      • n resolves to a NULL value
      • n does not resolve to a number
    • Returns NaN in the following cases:
      • n resolves to NaN
      • n is less than zero
    • Returns positive infinity if n resolves to positive infinity.
    • Returns negative infinity if n is positive/negative zero.
Example:
SELECT ln(n) FROM PHtable
Value of n Output
1 0.0
10 2.302585092994046
1.0E-7 -16.11809565095832