Lines Matching refs:ndigits
936 double_round(double x, int ndigits) { in double_round() argument
947 buf = _Py_dg_dtoa(x, 3, ndigits, &decpt, &sign, &buf_end); in double_round()
994 double_round(double x, int ndigits) { in double_round() argument
996 if (ndigits >= 0) { in double_round()
997 if (ndigits > 22) { in double_round()
1000 pow1 = pow(10.0, (double)(ndigits-22)); in double_round()
1004 pow1 = pow(10.0, (double)ndigits); in double_round()
1013 pow1 = pow(10.0, (double)-ndigits); in double_round()
1023 if (ndigits >= 0) in double_round()
1058 Py_ssize_t ndigits; in float___round___impl() local
1072 ndigits = PyNumber_AsSsize_t(o_ndigits, NULL); in float___round___impl()
1073 if (ndigits == -1 && PyErr_Occurred()) in float___round___impl()
1085 if (ndigits > NDIGITS_MAX) in float___round___impl()
1088 else if (ndigits < NDIGITS_MIN) in float___round___impl()
1093 return double_round(x, (int)ndigits); in float___round___impl()
1292 Py_ssize_t length, ndigits, fdigits, i; in float_fromhex() local
1392 ndigits = coeff_end - coeff_start; in float_fromhex()
1394 if (ndigits == 0) in float_fromhex()
1396 if (ndigits > Py_MIN(DBL_MIN_EXP - DBL_MANT_DIG - LONG_MIN/2, in float_fromhex()
1426 while (ndigits > 0 && HEX_DIGIT(ndigits-1) == 0) in float_fromhex()
1427 ndigits--; in float_fromhex()
1428 if (ndigits == 0 || exp < LONG_MIN/2) { in float_fromhex()
1439 top_exp = exp + 4*((long)ndigits - 1); in float_fromhex()
1440 for (digit = HEX_DIGIT(ndigits-1); digit != 0; digit /= 2) in float_fromhex()
1458 for (i = ndigits-1; i >= 0; i--) in float_fromhex()
1467 for (i = ndigits-1; i > key_digit; i--) in float_fromhex()