Project

General

Profile

Bug #9797

Math::log - missing domain error check

Added by cremno (cremno phobia) about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-05-03) [x64-mswin64_120]
[ruby-core:<unknown>]

Description

Math::log with a negative base should raise a Math::DomainError.

Math.log(-1.0)        # raises Math::DomainError
Math.log( 1.0, -1.0)  # doesn't (but calls `log(-1.0)` internally!)

Associated revisions

Revision 38656e24
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Revision 45795
Added by nobu (Nobuyoshi Nakada) about 5 years ago

math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

History

Updated by nobu (Nobuyoshi Nakada) about 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45795.


math.c: check domain of base argument

  • math.c (math_log): check domain of base argument too. raises Math::DomainError instead of returning NaN if the base is less than 0, and returns NaN instead of -infinity if both of two arguments are 0. [ruby-core:62309] [Bug #9797]

Updated by usa (Usaku NAKAMURA) almost 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: WONTFIX, 2.1: UNKNOWN

Updated by nagachika (Tomoyuki Chikanaga) almost 5 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: UNKNOWN to 2.0.0: WONTFIX, 2.1: WONTFIX

Also available in: Atom PDF