mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (num_div): don't use num_floor which is actually
flo_floor. * numeric.c (num_modulo): don't call '%'. * numeric.c (num_divmod): use num_modulo. * numeric.c: defined '%'. * rational.c (nurat_idiv,nurat_mod,nurat_divmod,nurat_rem): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a05fd849a1
commit
d82ed7e2c6
4 changed files with 64 additions and 169 deletions
|
@ -55,6 +55,7 @@ class TestNumeric < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_divmod
|
||||
=begin
|
||||
DummyNumeric.class_eval do
|
||||
def /(x); 42.0; end
|
||||
def %(x); :mod; end
|
||||
|
@ -63,13 +64,16 @@ class TestNumeric < Test::Unit::TestCase
|
|||
assert_equal(42, DummyNumeric.new.div(1))
|
||||
assert_equal(:mod, DummyNumeric.new.modulo(1))
|
||||
assert_equal([42, :mod], DummyNumeric.new.divmod(1))
|
||||
=end
|
||||
|
||||
assert_kind_of(Integer, 11.divmod(3.5).first, '[ruby-dev:34006]')
|
||||
|
||||
=begin
|
||||
ensure
|
||||
DummyNumeric.class_eval do
|
||||
remove_method :/, :%
|
||||
end
|
||||
=end
|
||||
end
|
||||
|
||||
def test_real_p
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue