diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-22 03:05:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-22 03:05:02 +0000 |
commit | 24ef8ad19015f5d84bd11bce0165059850036e9d (patch) | |
tree | a3a2fba7ee2f02cd1810b856be069015dbfe8875 /test/ruby/test_bignum.rb | |
parent | e3bb5c4ba3470b0e5803434ab7506591c8bc6cf4 (diff) | |
download | ruby-24ef8ad19015f5d84bd11bce0165059850036e9d.tar.gz |
numeric.c: use NUM2DBL
* numeric.c (fix_fdiv_double), bignum.c (rb_big_fdiv_double): use
NUM2DBL on unknown object. RFLOAT_VALUE is only appliicable to
T_FLOAT object. [ruby-core:82924] [Bug #13928]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_bignum.rb')
-rw-r--r-- | test/ruby/test_bignum.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index e680d28735..3ead77766d 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -693,6 +693,10 @@ class TestBignum < Test::Unit::TestCase o = Object.new def o.coerce(x); [x, 2**100]; end assert_equal((2**200).to_f, (2**300).fdiv(o)) + o = Object.new + def o.coerce(x); [self, x]; end + def o.fdiv(x); 1; end + assert_equal(1.0, (2**300).fdiv(o)) end def test_singleton_method |