Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre2
    • Fix Version/s: JRuby 1.7.0.RC1
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      Mac OSX 10.8
    • Number of attachments :
      0

      Description

      jruby Math.sqrt(Float::NAN) gives a Math::DomainError. MRI returns NaN.

      $ jruby --version
      jruby 1.7.0.preview2 (1.9.3p203) 2012-08-30 2900996 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_06-b24 [darwin-x86_64]

      $ jruby -e "p Math.sqrt(Float::NAN)"
      Math::DomainError: Numerical argument is out of domain - "sqrt"
      sqrt at org/jruby/RubyMath.java:494
      (root) at -e:1

      $ ruby --version
      ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]

      $ ruby -e "p Math.sqrt(Float::NAN)"
      NaN

        Activity

        Hide
        Charles Oliver Nutter added a comment -
        commit 94e8e142b0adea14b3b3f4cf75ad207fde733ba1
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Thu Aug 30 23:55:42 2012 -0500
        
            Fix JRUBY-6872 and remaining math excludes.
            
            Behavior of Math.sqrt(Float::NAN) does not match MRI
        
        :100644 100644 0e33488... b7cddb7... M	src/org/jruby/RubyMath.java
        :100644 000000 bc5ce79... 0000000... D	test/externals/ruby1.9/excludes/TestMath.rb
        
        commit abb2a55d604b5655a54019a80d1cf5c5d4ff923f
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Fri Aug 31 00:01:09 2012 -0500
        
            Actually fix JRUBY-6872.
        
        :100644 100644 b7cddb7... 76a7582... M	src/org/jruby/RubyMath.java
        
        Show
        Charles Oliver Nutter added a comment - commit 94e8e142b0adea14b3b3f4cf75ad207fde733ba1 Author: Charles Oliver Nutter <headius@headius.com> Date: Thu Aug 30 23:55:42 2012 -0500 Fix JRUBY-6872 and remaining math excludes. Behavior of Math.sqrt(Float::NAN) does not match MRI :100644 100644 0e33488... b7cddb7... M src/org/jruby/RubyMath.java :100644 000000 bc5ce79... 0000000... D test/externals/ruby1.9/excludes/TestMath.rb commit abb2a55d604b5655a54019a80d1cf5c5d4ff923f Author: Charles Oliver Nutter <headius@headius.com> Date: Fri Aug 31 00:01:09 2012 -0500 Actually fix JRUBY-6872. :100644 100644 b7cddb7... 76a7582... M src/org/jruby/RubyMath.java

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Colin Fuller
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: