mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (flodivmod): floating point division should raise
ZeroDivisionError as integer division. [incompatible] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ce5063c283
commit
90add5db45
3 changed files with 7 additions and 3 deletions
|
@ -172,9 +172,7 @@ class TestFloat < Test::Unit::TestCase
|
|||
assert_raise(TypeError) { 2.0.divmod(nil) }
|
||||
|
||||
inf = 1.0 / 0.0
|
||||
a, b = inf.divmod(0)
|
||||
assert(a.infinite?)
|
||||
assert(b.nan?)
|
||||
assert_raise(ZeroDivisionError) {inf.divmod(0)}
|
||||
|
||||
a, b = (2.0**32).divmod(1.0)
|
||||
assert_equal(2**32, a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue