Logarithmic Calculations (log, ln)

Evaluate logarithmic expressions using log (base 10) and ln (natural log). Understand the difference between common and natural logarithms with practical examples.

Logarithms

Detailed Explanation

Logarithms in the Evaluator

The evaluator provides two logarithm functions:

  • log(x) -- base-10 (common) logarithm
  • ln(x) -- base-e (natural) logarithm

Base-10 Logarithm

The common logarithm answers "10 raised to what power gives x?"

log(10)    = 1     (10^1 = 10)
log(100)   = 2     (10^2 = 100)
log(1000)  = 3     (10^3 = 1000)
log(1)     = 0     (10^0 = 1)
log(0.01)  = -2    (10^-2 = 0.01)

Natural Logarithm

The natural logarithm uses Euler's number e (approximately 2.71828) as its base:

ln(e)      = 1     (e^1 = e)
ln(1)      = 0     (e^0 = 1)
ln(e^2)    = 2
ln(2)      = 0.693
ln(10)     = 2.303

Converting Between Bases

You can convert from one base to another using the change-of-base formula:

log_b(x) = ln(x) / ln(b)

For example, log base 2 of 8: ln(8) / ln(2) = 3.

Practical Applications

  • Decibels: 20 * log(V2/V1) for voltage ratio
  • pH: -log(H_concentration)
  • Information theory: ln(2) * bits for nats
  • Compound growth: natural log for continuous compounding

Error Handling

Both log and ln require positive arguments. Attempting log(0) or ln(-1) produces a descriptive error message.

Use Case

A chemistry student calculating pH values from hydrogen ion concentrations, or an audio engineer computing decibel levels from power ratios.

Try It — Math Expression Evaluator

Open full tool