/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 | 343 def round2(number, ndigits=None): argument 357 if ndigits is None: 358 ndigits = 0 360 if ndigits < 0: 361 exponent = 10 ** (-ndigits) 367 exponent = _decimal.Decimal('10') ** (-ndigits) 383 def round3(number, ndigits=None): argument 384 return _round(number) if ndigits is None else _round(number, ndigits) 393 def round3(number, ndigits=None): argument 414 if ndigits is None: [all …]
|
/external/python/cpython3/Objects/ |
D | floatobject.c | 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 [all …]
|
D | longobject.c | 315 int ndigits = 0; in PyLong_FromLong() local 360 ++ndigits; in PyLong_FromLong() 363 v = _PyLong_New(ndigits); in PyLong_FromLong() 366 Py_SIZE(v) = ndigits*sign; in PyLong_FromLong() 384 int ndigits = 0; in PyLong_FromUnsignedLong() local 391 ++ndigits; in PyLong_FromUnsignedLong() 394 v = _PyLong_New(ndigits); in PyLong_FromUnsignedLong() 815 Py_ssize_t ndigits; in _PyLong_NumBits() local 820 ndigits = Py_ABS(Py_SIZE(v)); in _PyLong_NumBits() 821 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/python/cpython3/Python/ |
D | dtoa.c | 1445 size_t ndigits, fraclen; in _Py_dg_strtod() local 1476 ndigits = s - s1; in _Py_dg_strtod() 1482 if (!ndigits) { in _Py_dg_strtod() 1493 ndigits += s - s1; in _Py_dg_strtod() 1500 if (!ndigits && !lz) { in _Py_dg_strtod() 1508 if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { in _Py_dg_strtod() 1513 nd = (int)ndigits; in _Py_dg_strtod() 1514 nd0 = (int)ndigits - (int)fraclen; in _Py_dg_strtod() 2243 _Py_dg_dtoa(double dd, int mode, int ndigits, in _Py_dg_dtoa() argument 2411 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 135 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/ |
D | dtoa.h | 8 PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
|
/external/python/cpython3/Lib/ |
D | fractions.py | 531 def __round__(self, ndigits=None): argument 536 if ndigits is None: 547 shift = 10**abs(ndigits) 551 if ndigits > 0:
|
D | numbers.py | 189 def __round__(self, ndigits=None): argument
|
/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/python/cpython3/Doc/library/ |
D | fractions.rst | 166 __round__(ndigits) 170 nearest multiple of ``Fraction(1, 10**ndigits)`` (logically, if 171 ``ndigits`` is negative), again rounding half toward even. This
|
/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/icu/icu4c/source/i18n/ |
D | plurrule.cpp | 1621 for (int ndigits=0; ndigits<=3; ndigits++) { in decimals() local 1622 double scaledN = n * p10[ndigits]; in decimals() 1624 return ndigits; in decimals()
|
/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/libchrome/base/third_party/nspr/ |
D | prtime.cc | 791 int ndigits = end - rest; in PR_ParseTimeString() local 792 while (ndigits++ < 6) in PR_ParseTimeString()
|