Obtained from: 1.1.5 (originally by jtc)

Fix printf("%g", 0.0) - print "0", not "0.".  The previous fixes in this
area had one non-cosmetic (non-)change that caused this bug.

Bruce
This commit is contained in:
Bruce Evans 1995-04-06 16:28:15 +00:00
parent f85e2485b8
commit ffe57f1a20
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7649

View File

@ -730,7 +730,8 @@ number: if ((dprec = prec) >= 0)
if (ch >= 'f') { /* 'f' or 'g' */
if (_double == 0) {
/* kludge for __dtoa irregularity */
if (prec == 0 && (flags & ALT) == 0) {
if (expt >= ndig &&
(flags & ALT) == 0) {
PRINT("0", 1);
} else {
PRINT("0.", 2);