1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): bigdecimal

division (including modulo) should raise ZeroDivisionError as
  integer division. [incompatible]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-27 17:20:08 +00:00
parent 6fd76fdb14
commit 4d3f3af836
3 changed files with 10 additions and 7 deletions

View file

@ -419,9 +419,7 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal([0, 0], BigDecimal.new("0").divmod(2))
BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false)
a, b = BigDecimal.new("0").divmod(0)
assert_equal(true, a.nan?)
assert_equal(true, b.nan?)
assert_raise(ZeroDivisionError){BigDecimal.new("0").divmod(0)}
end
def test_add_bigdecimal