Lines Matching defs:ndigits

75 roundup(char *s0, int ndigits)
79 for (s = s0 + ndigits - 1; *s == 0xf; s--) {
91 * Round the given digit string to ndigits digits according to the
97 dorounding(char *s0, int ndigits, int sign, int *decpt)
106 if ((s0[ndigits] > 8) ||
107 (s0[ndigits] == 8 && s0[ndigits - 1] & 1))
108 adjust = roundup(s0, ndigits);
112 adjust = roundup(s0, ndigits);
116 adjust = roundup(s0, ndigits);
130 * - An ndigits < 0 causes it to use as many digits as necessary to
145 * Inputs: d, xdigs, ndigits
149 hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
191 if (ndigits == 0) /* dtoa() compatibility */
192 ndigits = 1;
198 bufsize = (sigfigs > ndigits) ? sigfigs : ndigits;
237 /* If ndigits < 0, we are expected to auto-size the precision. */
238 if (ndigits < 0) {
239 for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--)
243 if (sigfigs > ndigits && s0[ndigits] != 0)
244 dorounding(s0, ndigits, u.dblu_dbl.dbl_sign, decpt);
246 s = s0 + ndigits;
262 hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign,
297 if (ndigits == 0) /* dtoa() compatibility */
298 ndigits = 1;
304 bufsize = (sigfigs > ndigits) ? sigfigs : ndigits;
348 /* If ndigits < 0, we are expected to auto-size the precision. */
349 if (ndigits < 0) {
350 for (ndigits = sigfigs; s0[ndigits - 1] == 0; ndigits--)
354 if (sigfigs > ndigits && s0[ndigits] != 0)
355 dorounding(s0, ndigits, u.extu_ext.ext_sign, decpt);
357 s = s0 + ndigits;
370 hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign,
374 return (hdtoa((double)e, xdigs, ndigits, decpt, sign, rve));