* util.c (ruby_strtod): strtod("0", &end); => end should point '\0'.
[ruby-dev:23498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
793b2e8795
commit
91da320a9b
@ -1,3 +1,8 @@
|
|||||||
|
Fri May 14 12:13:46 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
|
* util.c (ruby_strtod): strtod("0", &end); => end should point '\0'.
|
||||||
|
[ruby-dev:23498]
|
||||||
|
|
||||||
Thu May 13 15:47:30 2004 akira yamada <akira@ruby-lang.org>
|
Thu May 13 15:47:30 2004 akira yamada <akira@ruby-lang.org>
|
||||||
|
|
||||||
* lib/net/telnet.rb (Net::Telnet::login): "options" can specify
|
* lib/net/telnet.rb (Net::Telnet::login): "options" can specify
|
||||||
|
14
util.c
14
util.c
@ -772,8 +772,8 @@ ruby_strtod(string, endPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Count the number of digits in the mantissa (including the decimal
|
* Count the number of digits in the mantissa
|
||||||
* point), and also locate the decimal point.
|
* and also locate the decimal point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for ( ; c = *p; p += 1) {
|
for ( ; c = *p; p += 1) {
|
||||||
@ -805,16 +805,14 @@ ruby_strtod(string, endPtr)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
pExp = p;
|
pExp = p;
|
||||||
p = pMant; /* valid if mantSize > 0 */
|
if (mantSize) {
|
||||||
|
p = pMant;
|
||||||
|
}
|
||||||
if (mantSize > 18) {
|
if (mantSize > 18) {
|
||||||
fracExp += (mantSize - 18);
|
fracExp += (mantSize - 18);
|
||||||
mantSize = 18;
|
mantSize = 18;
|
||||||
}
|
}
|
||||||
if (mantSize == 0) {
|
{
|
||||||
fraction = 0.0;
|
|
||||||
p = string;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
int frac1, frac2;
|
int frac1, frac2;
|
||||||
frac1 = 0;
|
frac1 = 0;
|
||||||
for ( ; mantSize > 9; mantSize -= 1) {
|
for ( ; mantSize > 9; mantSize -= 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user