summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-09-01 09:45:44 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-09-01 09:45:44 +0000
commit5e70346acb02e6541a2ec0d44be5d054d72f0ea1 (patch)
treefd1b91b4798383e466804b1b9b9e52e23352e696
parent9a927b3cbb4b309f01de9473e5aad69f41df1d9a (diff)
Fix precision bug for %g conversion specifier when using %f style.
-rw-r--r--libc/stdio/printf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/stdio/printf.c b/libc/stdio/printf.c
index da0444510..d7d23ddc0 100644
--- a/libc/stdio/printf.c
+++ b/libc/stdio/printf.c
@@ -69,6 +69,9 @@
* Floating point output now works for *wprintf.
* Support for glibc locale-specific digit grouping for floats.
* Misc bug fixes.
+ *
+ * Aug 31, 2003
+ * Fix precision bug for %g conversion specifier when using %f style.
*/
/* TODO:
@@ -77,9 +80,6 @@
* strings in the current locale? ANSI/ISO C99 seems to imply this
* and Plauger's printf implementation in his Standard C Library book
* treats this as an error.
- *
- * Implement %a, %A, and locale-specific grouping for the printf floating
- * point conversions. To be done in the rewrite of _dtostr().
*/
@@ -2110,6 +2110,7 @@ size_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
if ((mode == 'g') && ((o_exp >= -4) && (o_exp <= round))) {
mode = 'f';
+ preci = round - o_exp;
}
exp = o_exp;