diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-08 02:25:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-08 02:25:44 +0000 |
commit | 17e9667fe9707ff5f20cc320cbd111f886caa5b9 (patch) | |
tree | b98a66a057626de6f856e0229554ea9f31722cfc /test/ruby | |
parent | dcfb7f6d541ee7e80f6a05726e533d4b75a4b785 (diff) | |
download | ruby-17e9667fe9707ff5f20cc320cbd111f886caa5b9.tar.gz |
refine parse_rat
* rational.c (read_num): return the exponent instead of the
divisor, to get rid of huge bignums.
* rational.c (parse_rat): subtract exponents instead of reduction
of powers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_rational.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index c44ff0393a..b289753347 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -120,6 +120,9 @@ class Rational_Test < Test::Unit::TestCase assert_raise_with_message(ArgumentError, /\u{221a 2668}/) { Rational("\u{221a 2668}") } + assert_warning('') { + assert_predicate(Rational('1e-99999999999999999999'), :zero?) + } assert_raise(TypeError){Rational(Object.new)} assert_raise(TypeError){Rational(Object.new, Object.new)} |