Log10 v0.1.0

Source
Returns the base-10 logarithm.

Package: Math

Signature

func Log10(x: float64) -> float64;
func Log10(x: float32) -> float32;

Parameters

NameTypeDescription
xfloat64 / float32A non-negative value.

Returns

log₁₀(x), in the same precision as the argument. Log10(±0.0) is -Inf; Log10 of a negative value is a NaN; Log10(+Inf) is +Inf; a NaN propagates.

Example

import Math::Log10;

func Main() -> int {
    let a = Log10(1000.0); // 3.0
    let b = Log10(1.0);    // 0.0
    return 0;
}

See also

  • Math — the package overview
  • Log — natural logarithm
  • Log2 — base-2 logarithm
  • Exp — exponentiation with base e