Backport #9305

BigDecimal inconsistent between 2.0, 2.1 (probably incorrect on 2.1)

Added by Kurt Werle over 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:-

Description

BigDecimal / BigDecimal seems to round off.

The test case has not been reduced to trivial, but it's pretty small and should be pretty clear.

ruby bigdecimal_spec.rb
passes for ruby 2.0.

Fails for ruby 2.1

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]

bigdecimal_spec.rb Magnifier (779 Bytes) Kurt Werle, 12/27/2013 06:57 AM

Associated revisions

Revision 44588
Added by Kenta Murata about 1 year ago

  • ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
    digit for the quotient to be compatible with bigdecimal 1.2.1 and
    the former. [#9316] [#9305]

  • test/bigdecimal/test_bigdecimal.rb: tests for the above change.

  • ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4.

Revision 44711
Added by Yui NARUSE about 1 year ago

merge revision(s) 44588: [Backport #9316]

* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additional
  digit for the quotient to be compatible with bigdecimal 1.2.1 and
  the former.   [#9316] [#9305]

* test/bigdecimal/test_bigdecimal.rb: tests for the above change.

* ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4.

History

#1 Updated by Zachary Scott about 1 year ago

  • Status changed from Open to Feedback

Without an actual patch, I don't think we can merge a failing test.

Could you help in the discussion on #9316?

#2 Updated by Zachary Scott about 1 year ago

  • Status changed from Feedback to Closed

Also we don't accept backport tickets directly, if the bug exists in trunk it should be reported and fix there first.

Thanks!

Also available in: Atom PDF