+ /* With %g precision is the number of significant digits, which
+ includes the digits in intpart. */
+ if (flags & DP_F_FP_G)
+ {
+ if (intpart != 0)
+ {
+ /* For each digit of INTPART, print one less fractional digit. */
+ LLONG temp = intpart;
+ for (temp = intpart; temp != 0; temp /= 10)
+ --max;
+ if (max < 0)
+ max = 0;
+ }
+ else
+ {
+ /* For each leading 0 in fractional part, print one more
+ fractional digit. */
+ LDOUBLE temp;
+ if (ufvalue != 0)
+ for (temp = ufvalue; temp < 0.1; temp *= 10)
+ ++max;
+ }
+ }
+
+ /* C99: trailing zeros are removed from the fractional portion of the
+ result unless the # flag is specified */
+ if ((flags & DP_F_FP_G) && !(flags & DP_F_NUM))
+ omitzeros = 1;
+
+#if SIZEOF_LONG_LONG > 0
+# define MAX_DIGITS 18 /* grok more digits with long long */
+#else
+# define MAX_DIGITS 9 /* just long */
+#endif
+