提交 e314258e 编写于 作者: R Rich Felker

fix minor problem in previous strtod non-nearest rounding bug fix

commit 6ffdc457 set lnz in the code
path for non-zero digits after a huge string of zeros, but the
assignment of dc to lnz truncates if the value of dc does not fit in
int; this is possible for some pathologically long inputs, either via
strings on 64-bit systems or via scanf-family functions.

instead, simply set lnz to match the point at which we add the
artificial trailing 1 bit to simulate nonzero digits after a huge
run of zeros.
上级 6ffdc457
......@@ -111,7 +111,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
} else {
dc++;
if (c!='0') {
lnz = dc;
lnz = (KMAX-4)*9;
x[KMAX-4] |= 1;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册