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

Comments

Projects
None yet
4 participants
@headius
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

headius commented Nov 8, 2014

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

@headius

This comment has been minimized.

Copy link
Member Author

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
@tduehr

This comment has been minimized.

Copy link
Contributor

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: 

@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015

@kares kares added the JRuby 9000 label Jul 23, 2015

@kares

This comment has been minimized.

Copy link
Member

kares commented Aug 5, 2015

expected to be fixed at #3221

@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
You can’t perform that action at this time.