Lines Matching refs:n_digits

11143 static void js_ecvt1(double d, int n_digits, int* decpt, int* sign, char* buf,
11146 snprintf(buf1, buf1_size, "%+.*e", n_digits - 1, d);
11150 if (n_digits > 1)
11151 memcpy(buf + 1, buf1 + 3, n_digits - 1);
11152 buf[n_digits] = '\0';
11154 *decpt = atoi(buf1 + n_digits + 2 + (n_digits > 1)) + 1;
11162 static int js_ecvt(double d, int n_digits, int* decpt, int* sign, char* buf,
11174 n_digits = (n_digits_min + n_digits_max) / 2;
11175 js_ecvt1(d, n_digits, decpt, sign, buf, FE_TONEAREST,
11179 while (n_digits >= 2 && buf[n_digits - 1] == '0')
11180 n_digits--;
11181 n_digits_max = n_digits;
11183 n_digits_min = n_digits + 1;
11186 n_digits = n_digits_max;
11198 js_ecvt1(d, n_digits + 1, &decpt1, &sign1, buf1, FE_TONEAREST,
11201 if (buf1[n_digits] == '5') {
11202 js_ecvt1(d, n_digits + 1, &decpt1, &sign1, buf1, FE_DOWNWARD,
11204 js_ecvt1(d, n_digits + 1, &decpt2, &sign2, buf2, FE_UPWARD,
11206 if (memcmp(buf1, buf2, n_digits + 1) == 0 && decpt1 == decpt2) {
11217 js_ecvt1(d, n_digits, decpt, sign, buf, rounding_mode,
11219 return n_digits;
11222 static int js_fcvt1(char* buf, int buf_size, double d, int n_digits,
11226 n = snprintf(buf, buf_size, "%.*f", n_digits, d);
11231 static void js_fcvt(char* buf, int buf_size, double d, int n_digits)
11245 n1 = js_fcvt1(buf1, sizeof(buf1), d, n_digits + 1, FE_TONEAREST);
11249 n1 = js_fcvt1(buf1, sizeof(buf1), d, n_digits + 1, FE_DOWNWARD);
11250 n2 = js_fcvt1(buf2, sizeof(buf2), d, n_digits + 1, FE_UPWARD);
11261 js_fcvt1(buf, buf_size, d, n_digits, rounding_mode);
11267 /* use n_digits significant digits (1 <= n_digits <= 101) */
11269 /* force fractional format: [-]dd.dd with n_digits fractional digits */
11277 static void js_dtoa1(char* buf, double d, int radix, int n_digits, int flags)
11303 js_fcvt(buf, JS_DTOA_BUF_SIZE, d, n_digits);
11311 n_max = n_digits;
11316 k = js_ecvt(d, n_digits, &decpt, &sign, buf1, is_fixed);
11367 double d, int radix, int n_digits, int flags)
11370 js_dtoa1(buf, d, radix, n_digits, flags);