Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Math.log10

Math.log10(x) → float

Returns the base 10 logarithm of x.

  • Domain: [0, INFINITY].

  • Range: [-INFINITY, INFINITY].

Examples:

Example
log10(0.0)      # => -Infinity
log10(1.0)      # => 0.0
log10(10.0)     # => 1.0
log10(INFINITY) # => Infinity
See also .log .log2 .lgamma .sin also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0