Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigMath.log fails MRI 2.2 tests #2148

Closed
headius opened this issue Nov 8, 2014 · 4 comments
Closed

BigMath.log fails MRI 2.2 tests #2148

headius opened this issue Nov 8, 2014 · 4 comments

Comments

@headius
Copy link
Member

@headius headius commented Nov 8, 2014

The most recent tests from MRI trunk (2.2) fail on JRuby's BigMath.log with the following error:

  1) Error:
TestBigMath#test_log:
Math::DomainError: Math::DomainError
    file:/Users/headius/projects/jruby/lib/jruby.jar!/jruby/bigdecimal.rb:24:in `log'
    /Users/headius/projects/jruby/test/mri/bigdecimal/test_bigmath.rb:72:in `(root)'
    /Users/headius/projects/jruby/test/mri/bigdecimal/test_bigmath.rb:70:in `test_log'

The test can be run like this to reproduce:

jruby test/mri/runner.rb bigdecimal/test_bigmath.rb -n test_log

I will exclude this failure and reference this bug. We do have many other failures currently excluded; at some point we should make an effort to fix these :-\

It's possible some pass and no longer need to be excluded. I have not audited them in a while.

@headius headius added this to the JRuby 9.0.0.0 milestone Nov 8, 2014
@headius
Copy link
Member Author

@headius headius commented Nov 8, 2014

@petervandenabeele If you're still interested in helping, here's a nice opportunity :-)

Loading

@headius
Copy link
Member Author

@headius headius commented Nov 8, 2014

Failing test in question:

  def test_log
    assert_equal(0, BigMath.log(BigDecimal("1.0"), 10))
    assert_in_epsilon(Math.log(10)*1000, BigMath.log(BigDecimal("1e1000"), 10))
    assert_raise(Math::DomainError) {BigMath.log(BigDecimal("0"), 10)}
    assert_raise(Math::DomainError) {BigMath.log(BigDecimal("-1"), 10)}
    assert_separately(%w[-rbigdecimal], <<-SRC)
    begin
      x = BigMath.log(BigDecimal("1E19999999999999"), 10)
    rescue FloatDomainError
    else
      unless x.infinite?
        assert_in_epsilon(Math.log(10)*19999999999999, x)
      end
    end
    SRC
  end

Loading

@tduehr
Copy link
Contributor

@tduehr tduehr commented Nov 14, 2014

This is a flaw in java.math.BigDecimal.

irb(main):025:0> java.math.BigDecimal.new "1E19999999999999", java.math.MathContext::UNLIMITED
Java::JavaLang::NumberFormatException: 

Loading

@enebo enebo removed this from the JRuby 9.0.0.0 milestone Jul 14, 2015
@enebo enebo removed this from the JRuby 9.0.0.0 milestone Jul 14, 2015
@kares
Copy link
Member

@kares kares commented Aug 5, 2015

expected to be fixed at #3221

Loading

@kares kares closed this Aug 5, 2015
@kares kares added this to the JRuby 9.0.1.0 milestone Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants