mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 19:00:27 +00:00
stdio fmt: fix %.0g by treating it the same as %.1g
This commit is contained in:
parent
625d42d52a
commit
b4d07616a3
1 changed files with 2 additions and 2 deletions
|
@ -335,10 +335,10 @@ int __fmt_dtoa(int (*out)(const char *, void *, size_t), void *arg, int d,
|
|||
case 'G':
|
||||
case 'g':
|
||||
if (!(flags & FLAGS_PRECISION)) prec = 6;
|
||||
if (prec < 0) prec = 0;
|
||||
if (prec < 1) prec = 1;
|
||||
if (!longdouble) {
|
||||
x = va_arg(va, double);
|
||||
s = s0 = dtoa(x, prec ? 2 : 0, prec, &decpt, &fpb.sign, &se);
|
||||
s = s0 = dtoa(x, 2, prec, &decpt, &fpb.sign, &se);
|
||||
if (decpt == 9999) {
|
||||
if (s && s[0] == 'N') {
|
||||
fpb.kind = STRTOG_NaN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue