Bignum#div should never return non-integer values, even if arg is Float
-----------------------------------------------------------------------

                 Key: JRUBY-2536
                 URL: http://jira.codehaus.org/browse/JRUBY-2536
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.1
         Environment: Latest JRuby 1.1.1+ from trunk.
            Reporter: Vladimir Sizikov


According to ruby-core folks (akr), MRI 1.8.6 has a bug, so that Bignum#div 
returns non-integer values if the arg is Float.

The bug has been fixed in newer versions (1.8.7, 1.9), and the rubyspec has 
been updated to enforce proper behavior.

Since, JRuby followed the 1.8.6 behavior, it now fails the spec too.:

{noformat}
mspec -t j 1.8/core/bignum/div_spec.rb
....F

1)
Bignum#div returns self divided by float FAILED
Expected 2147483648.5
 to equal 2147483648

/opt/work/mspec.git/lib/mspec/expectations/expectations.rb:10:in `fail_with'
/opt/work/mspec.git/lib/mspec/matchers/base.rb:9:in `=='
/opt/work/spec/ruby/./1.8/core/bignum/div_spec.rb:9:in 
`/opt/work/spec/ruby/./1.8/core/bignum/div_spec.rb'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `instance_eval'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `protect'
/opt/work/mspec.git/lib/mspec/runner/state.rb:46:in `each'
/opt/work/mspec.git/lib/mspec/runner/state.rb:46:in `protect'
/opt/work/mspec.git/lib/mspec/runner/state.rb:60:in `process'
/opt/work/mspec.git/lib/mspec/runner/state.rb:56:in `each'
/opt/work/mspec.git/lib/mspec/runner/state.rb:56:in `process'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:27:in `describe'
/opt/work/mspec.git/lib/mspec/runner/object.rb:11:in `describe'
/opt/work/spec/ruby/./1.8/core/bignum/div_spec.rb:4:in 
`/opt/work/spec/ruby/./1.8/core/bignum/div_spec.rb'
/opt/work/spec/ruby/./1.8/core/bignum/div_spec.rb:45:in `load'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:45:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `instance_eval'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `protect'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:45:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:42:in `each'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:42:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:34:in `process'
/opt/work/mspec.git/bin/mspec-run:76:in `run'
/opt/work/mspec.git/lib/mspec/utils/script.rb:75:in `main'
/opt/work/mspec.git/bin/mspec-run:83
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to