module Polyfill::V2_2::Math::ClassMethods

Public Instance Methods

log(*args) click to toggle source
Calls superclass method
# File lib/polyfill/v2_2/math.rb, line 5
def log(*args)
  if (base = args[1])
    base = InternalUtils.to_f(base)
    raise ::Math::DomainError, 'Numerical argument is out of domain - "log"' if base < 0

    x = args[0]
    return 0 / 0.0 if base == 0 && InternalUtils.to_f(x) == 0
  end

  super
end