Overview

Logarithmic functions are the inverse of exponential functions, used to solve for unknowns in exponential equations.

  • log (common logarithm): Logarithm with base 10, written as log₁₀(x) or lg(x)
  • ln (natural logarithm): Logarithm with base e (≈2.718), written as logₑ(x)

Logarithms are widely used in science, engineering, finance, and information theory.

Syntax

log(value) // Calculate base-10 logarithm
ln(value) // Calculate natural logarithm (base e)

Input value must be greater than 0, otherwise returns error

Examples

Example 1: Calculate log(100)
Input: log(100)
Result: 2
Because 10² = 100
Example 2: Calculate log(1000)
Input: log(1000)
Result: 3
Because 10³ = 1000
Example 3: Calculate ln(e)
Input: ln(e)
Result: 1
Because e¹ = e, so ln(e) = 1
Example 4: Calculate ln(1)
Input: ln(1)
Result: 0
Any number to the 0 power equals 1, so ln(1) = 0
Example 5: Combined calculation
Input: log(100) + ln(e)
Result: 3

Change of Base Formula

Change of base formula:

logₐ(b) = ln(b) / ln(a)

For example, to calculate log base 2 of 8:

ln(8) / ln(2) = 3

Important Notes

  1. Input value must be positive (x > 0)
  2. log(0) and ln(0) are mathematically undefined
  3. Logarithm of negative numbers is undefined in real numbers
  4. log(1) = ln(1) = 0