mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
stdio fmt: fix %.0e by always rounding even if precision is 0
This commit is contained in:
parent
e5f705ace3
commit
625d42d52a
1 changed files with 1 additions and 1 deletions
|
@ -379,7 +379,7 @@ int __fmt_dtoa(int (*out)(const char *, void *, size_t), void *arg, int d,
|
||||||
if (prec < 0) prec = 0;
|
if (prec < 0) prec = 0;
|
||||||
if (!longdouble) {
|
if (!longdouble) {
|
||||||
x = va_arg(va, double);
|
x = va_arg(va, double);
|
||||||
s = s0 = dtoa(x, prec ? 2 : 0, prec + 1, &decpt, &fpb.sign, &se);
|
s = s0 = dtoa(x, 2, prec + 1, &decpt, &fpb.sign, &se);
|
||||||
if (decpt == 9999) {
|
if (decpt == 9999) {
|
||||||
if (s && s[0] == 'N') {
|
if (s && s[0] == 'N') {
|
||||||
fpb.kind = STRTOG_NaN;
|
fpb.kind = STRTOG_NaN;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue