mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 04:24:04 +02:00
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
This commit is contained in:
parent
dcfb7f6d54
commit
17e9667fe9
2 changed files with 43 additions and 25 deletions
|
@ -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)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue