Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)

log10() : Base-10 Logarithm

Calculate the base-10 logarithm of a number.


On this page

Signature

log10(value)

Parameters

Parameter Type Required Description
value Number Yes The number (must be positive)

Returns

Type: Double

The base-10 logarithm of the value.


Examples

Basic Log10

<p>log₁₀({{model.value}}) = {{format(log10(model.value), '0.000')}}</p>

Data:

doc.Params["model"] = new {
    value = 100
};

Output:

<p>log₁₀(100) = 2.000</p>

Calculate Magnitude

<p>Order of magnitude: 10^{{floor(log10(model.value))}}</p>

Data:

doc.Params["model"] = new {
    value = 45000
};

Output:

<p>Order of magnitude: 10^4</p>

Decibel Calculation

<p>dB: {{format(10 * log10(model.power / model.reference), '0.0')}}</p>

Data:

doc.Params["model"] = new {
    power = 100,
    reference = 1
};

Output:

<p>dB: 20.0</p>

Notes

  • Value must be positive (> 0)
  • Returns double-precision floating-point
  • Common in scientific and engineering calculations
  • For natural logarithm, use log()
  • log10(10) = 1, log10(100) = 2, log10(1000) = 3

See Also