/external/python/cpython3/Modules/_decimal/tests/ |
D | randdec.py | 127 def ndigits(n): function 134 coeff = ndigits(maxprec) 139 coeff = tuple(map(int, str(ndigits(maxprec)))) 142 coeff = tuple(map(int, str(ndigits(maxprec)))) 319 yield from_triple(1, ndigits(m), 0) 320 yield from_triple(-1, ndigits(m), 0) 321 yield from_triple(1, ndigits(m), randrange(maxexp)) 322 yield from_triple(-1, ndigits(m), randrange(maxexp)) 332 yield from_triple(1, ndigits(m), 0) 333 yield from_triple(-1, ndigits(m), 0) [all …]
|
/external/fonttools/Lib/fontTools/misc/ |
D | py23.py | 121 def round2(number, ndigits=None): argument 132 if ndigits is None: 133 ndigits = 0 135 if ndigits < 0: 136 exponent = 10 ** (-ndigits) 142 exponent = _decimal.Decimal("10") ** (-ndigits)
|
/external/python/cpython3/Objects/ |
D | floatobject.c | 906 double_round(double x, int ndigits) { in double_round() argument 917 buf = _Py_dg_dtoa(x, 3, ndigits, &decpt, &sign, &buf_end); in double_round() 964 double_round(double x, int ndigits) { in double_round() argument 966 if (ndigits >= 0) { in double_round() 967 if (ndigits > 22) { in double_round() 970 pow1 = pow(10.0, (double)(ndigits-22)); in double_round() 974 pow1 = pow(10.0, (double)ndigits); in double_round() 983 pow1 = pow(10.0, (double)-ndigits); in double_round() 993 if (ndigits >= 0) in double_round() 1028 Py_ssize_t ndigits; in float___round___impl() local [all …]
|
D | longobject.c | 302 int ndigits = 0; in PyLong_FromLong() local 349 ++ndigits; in PyLong_FromLong() 352 v = _PyLong_New(ndigits); in PyLong_FromLong() 355 Py_SET_SIZE(v, ndigits * sign); in PyLong_FromLong() 372 Py_ssize_t ndigits = 0; \ 375 ++ndigits; \ 378 PyLongObject *v = _PyLong_New(ndigits); \ 819 Py_ssize_t ndigits; in _PyLong_NumBits() local 824 ndigits = Py_ABS(Py_SIZE(v)); in _PyLong_NumBits() 825 assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); in _PyLong_NumBits() [all …]
|
/external/python/cpython2/Objects/ |
D | floatobject.c | 1091 _Py_double_round(double x, int ndigits) { in _Py_double_round() argument 1101 if (ndigits == 0) { in _Py_double_round() 1147 if (val == -ndigits-1) { in _Py_double_round() 1148 if (ndigits >= 0) in _Py_double_round() 1150 else if (ndigits >= -FIVE_POW_LIMIT) { in _Py_double_round() 1153 for (i=0; i < -ndigits; i++) in _Py_double_round() 1165 buf = _Py_dg_dtoa(x, 3, ndigits+halfway_case, &decpt, &sign, &buf_end); in _Py_double_round() 1180 assert(buflen - decpt == ndigits+1); in _Py_double_round() 1235 _Py_double_round(double x, int ndigits) { in _Py_double_round() argument 1237 if (ndigits >= 0) { in _Py_double_round() [all …]
|
D | longobject.c | 106 int ndigits = 0; in PyLong_FromLong() local 126 ++ndigits; in PyLong_FromLong() 129 v = _PyLong_New(ndigits); in PyLong_FromLong() 132 Py_SIZE(v) = negative ? -ndigits : ndigits; in PyLong_FromLong() 149 int ndigits = 0; in PyLong_FromUnsignedLong() local 154 ++ndigits; in PyLong_FromUnsignedLong() 157 v = _PyLong_New(ndigits); in PyLong_FromUnsignedLong() 160 Py_SIZE(v) = ndigits; in PyLong_FromUnsignedLong() 496 Py_ssize_t ndigits; in _PyLong_NumBits() local 500 ndigits = ABS(Py_SIZE(v)); in _PyLong_NumBits() [all …]
|
/external/fonttools/Lib/fontTools/cu2qu/ |
D | errors.py | 58 ndigits = len(str(max(self.segments))) 61 "%s: (%s)" % (str(i).rjust(ndigits), ", ".join(repr(t) for t in tags))
|
/external/python/cpython3/Python/ |
D | dtoa.c | 1449 size_t ndigits, fraclen; in _Py_dg_strtod() local 1480 ndigits = s - s1; in _Py_dg_strtod() 1486 if (!ndigits) { in _Py_dg_strtod() 1497 ndigits += s - s1; in _Py_dg_strtod() 1504 if (!ndigits && !lz) { in _Py_dg_strtod() 1512 if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { in _Py_dg_strtod() 1517 nd = (int)ndigits; in _Py_dg_strtod() 1518 nd0 = (int)ndigits - (int)fraclen; in _Py_dg_strtod() 2247 _Py_dg_dtoa(double dd, int mode, int ndigits, in _Py_dg_dtoa() argument 2415 ndigits = 0; in _Py_dg_dtoa() [all …]
|
/external/openssh/openbsd-compat/ |
D | fmt_scaled.c | 80 unsigned int i, ndigits = 0, fract_digits = 0; in scan_scaled() local 139 if (++ndigits >= MAX_DIGITS) { in scan_scaled()
|
/external/python/cpython2/Python/ |
D | dtoa.c | 1518 size_t ndigits, fraclen; in _Py_dg_strtod() local 1548 ndigits = s - s1; in _Py_dg_strtod() 1554 if (!ndigits) { in _Py_dg_strtod() 1565 ndigits += s - s1; in _Py_dg_strtod() 1572 if (!ndigits && !lz) { in _Py_dg_strtod() 1580 if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { in _Py_dg_strtod() 1585 nd = (int)ndigits; in _Py_dg_strtod() 1586 nd0 = (int)ndigits - (int)fraclen; in _Py_dg_strtod() 2345 _Py_dg_dtoa(double dd, int mode, int ndigits, in _Py_dg_dtoa() argument 2513 ndigits = 0; in _Py_dg_dtoa() [all …]
|
D | bltinmodule.c | 2180 Py_ssize_t ndigits; in builtin_round() local 2189 ndigits = 0; in builtin_round() 2193 ndigits = PyNumber_AsSsize_t(o_ndigits, NULL); in builtin_round() 2194 if (ndigits == -1 && PyErr_Occurred()) in builtin_round() 2207 if (ndigits > NDIGITS_MAX) in builtin_round() 2210 else if (ndigits < NDIGITS_MIN) in builtin_round() 2216 return _Py_double_round(x, (int)ndigits); in builtin_round()
|
/external/python/cpython2/Include/ |
D | dtoa.h | 7 PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
|
D | floatobject.h | 133 PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
|
/external/python/cpython3/Include/internal/ |
D | pycore_dtoa.h | 14 PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
|
/external/python/cpython3/Lib/ |
D | fractions.py | 505 def __round__(self, ndigits=None): argument 510 if ndigits is None: 521 shift = 10**abs(ndigits) 525 if ndigits > 0:
|
D | numbers.py | 189 def __round__(self, ndigits=None): argument
|
/external/python/cpython3/Doc/library/ |
D | fractions.rst | 170 __round__(ndigits) 174 nearest multiple of ``Fraction(1, 10**ndigits)`` (logically, if 175 ``ndigits`` is negative), again rounding half toward even. This
|
/external/python/cpython3/Python/clinic/ |
D | bltinmodule.c.h | 717 builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits); 728 PyObject *ndigits = Py_None; in builtin_round() local 738 ndigits = args[1]; in builtin_round() 740 return_value = builtin_round_impl(module, number, ndigits); in builtin_round()
|
/external/icu/icu4c/source/common/ |
D | unames.cpp | 453 int ndigits, i; in getExtName() local 460 for (cp = code, ndigits = 0; cp; ++ndigits, cp >>= 4) in getExtName() 462 if (ndigits < 4) in getExtName() 463 ndigits = 4; in getExtName() 464 for (cp = code, i = ndigits; (cp || i > 0) && bufferLength; cp >>= 4, bufferLength--) { in getExtName() 468 buffer += ndigits; in getExtName() 469 length += static_cast<uint16_t>(ndigits); in getExtName()
|
/external/libpng/contrib/tools/ |
D | pngfix.c | 188 int ndigits = 0; in uarb_set() local 192 result[ndigits++] = (png_uint_16)(val & 0xffff); in uarb_set() 196 return ndigits; in uarb_set() 334 uarb_shift(uarb inout, int ndigits, unsigned int right_shift) in uarb_shift() argument 339 FIX_GCC int i = ndigits; in uarb_shift() 354 if (i == ndigits-1 && temp == 0) in uarb_shift() 355 ndigits = i; in uarb_shift() 358 return ndigits; in uarb_shift() 2245 max_window_bits(uarbc size, int ndigits) in max_window_bits() argument 2250 if (ndigits > 1) in max_window_bits()
|
/external/python/cpython2/Lib/test/ |
D | test_long.py | 98 def getran(self, ndigits): argument 99 self.assertGreater(ndigits, 0) 100 nbits_hi = ndigits * SHIFT 122 def getran2(ndigits): argument 124 for i in xrange(ndigits):
|
/external/pdfium/third_party/libpng16/ |
D | png.c | 3254 unsigned int ndigits = 0, first = 16 /* flag value */; 3262 digits[ndigits++] = (char)(48 + num); 3267 first = ndigits; 3271 if (ndigits > 0) 3273 while (ndigits > 5) *ascii++ = digits[--ndigits]; 3286 while (ndigits < i) 3290 while (ndigits >= first) *ascii++ = digits[--ndigits];
|
/external/libpng/ |
D | png.c | 3253 unsigned int ndigits = 0, first = 16 /* flag value */; 3261 digits[ndigits++] = (char)(48 + num); 3266 first = ndigits; 3270 if (ndigits > 0) 3272 while (ndigits > 5) *ascii++ = digits[--ndigits]; 3285 while (ndigits < i) 3289 while (ndigits >= first) *ascii++ = digits[--ndigits];
|
/external/python/cpython3/Lib/test/ |
D | test_long.py | 123 def getran(self, ndigits): argument 124 self.assertGreater(ndigits, 0) 125 nbits_hi = ndigits * SHIFT 147 def getran2(ndigits): argument 149 for i in range(ndigits):
|
/external/icu/icu4c/source/i18n/ |
D | plurrule.cpp | 1768 for (int ndigits=0; ndigits<=3; ndigits++) { in decimals() local 1769 double scaledN = n * p10[ndigits]; in decimals() 1771 return ndigits; in decimals()
|