mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
util.c: do not underflow
* util.c (ruby_strtod): do not underflow only by preceeding zeros, which may be canceled out by the exponent. http://twitter.com/kazuho/status/753829998767714305 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
363c90853e
commit
5292b2727a
3 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Jul 15 17:08:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* util.c (ruby_strtod): do not underflow only by preceeding zeros,
|
||||||
|
which may be canceled out by the exponent.
|
||||||
|
http://twitter.com/kazuho/status/753829998767714305
|
||||||
|
|
||||||
Fri Jul 15 15:32:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jul 15 15:32:13 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* time.c (time_arg): it seems that this function sometimes causes SEGV
|
* time.c (time_arg): it seems that this function sometimes causes SEGV
|
||||||
|
|
|
@ -493,6 +493,7 @@ class TestRubyLiteral < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert_equal(100.0, 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100e100)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_symbol_list
|
def test_symbol_list
|
||||||
|
|
2
util.c
2
util.c
|
@ -2145,7 +2145,7 @@ break2:
|
||||||
for (; c >= '0' && c <= '9'; c = *++s) {
|
for (; c >= '0' && c <= '9'; c = *++s) {
|
||||||
have_dig:
|
have_dig:
|
||||||
nz++;
|
nz++;
|
||||||
if (nf > DBL_DIG * 4) continue;
|
if (nd > DBL_DIG * 4) continue;
|
||||||
if (c -= '0') {
|
if (c -= '0') {
|
||||||
nf += nz;
|
nf += nz;
|
||||||
for (i = 1; i < nz; i++)
|
for (i = 1; i < nz; i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue