Tabular IQ
Back to Function Index

LN()

Overview

LN() returns the natural logarithm (base e) of a number. The natural logarithm is the inverse of the exponential function EXP(). If the input is invalid (e.g., negative numbers or zero), the function returns zero. This function is useful for mathematical calculations, statistical analysis, and scientific computations.

Function Format

LN(numeric)

Return Value

LN() returns a numeric value

Examples


LN(1) = 0                    (natural log of 1 is 0)
LN(10) = 2.3026             (natural log of 10)
LN(EXP(1)) = 1              (natural log of e is 1)
LN(EXP(10)) = 10            (natural log of e^10 is 10)
LN(2.71828) ≈ 1             (natural log of e is approximately 1)
LN(0) = 0                   (invalid input)
LN(-1) = 0                  (invalid input)
LN(NULL) = NULL             (NULL input)

Notes

  • Important behaviors:
    • Returns 0 for invalid inputs (negative numbers or zero)
    • Returns NULL for NULL input
    • Natural logarithm uses base e (approximately 2.71828)
    • LN(1) always equals 0
    • LN(EXP(x)) equals x for valid inputs
  • Common use cases include:
    • Mathematical calculations
    • Statistical analysis
    • Scientific computations
    • Growth rate calculations
    • Data transformation
  • The function can be used with:
    • Numeric literals
    • Numeric columns
    • Numeric expressions
    • Other numeric functions
  • This function is often used in combination with other mathematical functions like EXP(), LOG(), and POWER() for more complex calculations.
  • For logarithms with different bases, use the LOG() function instead.

See Also