/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 | 927 double_round(double x, int ndigits) { in double_round() argument 938 buf = _Py_dg_dtoa(x, 3, ndigits, &decpt, &sign, &buf_end); in double_round() 985 double_round(double x, int ndigits) { in double_round() argument 987 if (ndigits >= 0) { in double_round() 988 if (ndigits > 22) { in double_round() 991 pow1 = pow(10.0, (double)(ndigits-22)); in double_round() 995 pow1 = pow(10.0, (double)ndigits); in double_round() 1004 pow1 = pow(10.0, (double)-ndigits); in double_round() 1014 if (ndigits >= 0) in double_round() 1049 Py_ssize_t ndigits; in float___round___impl() local [all …]
|
D | longobject.c | 248 int ndigits = 0; in PyLong_FromLong() local 293 ++ndigits; in PyLong_FromLong() 296 v = _PyLong_New(ndigits); in PyLong_FromLong() 299 Py_SIZE(v) = ndigits*sign; in PyLong_FromLong() 317 int ndigits = 0; in PyLong_FromUnsignedLong() local 324 ++ndigits; in PyLong_FromUnsignedLong() 327 v = _PyLong_New(ndigits); in PyLong_FromUnsignedLong() 748 Py_ssize_t ndigits; in _PyLong_NumBits() local 753 ndigits = Py_ABS(Py_SIZE(v)); in _PyLong_NumBits() 754 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 1475 ndigits = s - s1; in _Py_dg_strtod() 1481 if (!ndigits) { in _Py_dg_strtod() 1492 ndigits += s - s1; in _Py_dg_strtod() 1499 if (!ndigits && !lz) { in _Py_dg_strtod() 1507 if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { in _Py_dg_strtod() 1512 nd = (int)ndigits; in _Py_dg_strtod() 1513 nd0 = (int)ndigits - (int)fraclen; in _Py_dg_strtod() 2272 _Py_dg_dtoa(double dd, int mode, int ndigits, in _Py_dg_dtoa() argument 2440 ndigits = 0; in _Py_dg_dtoa() [all …]
|
/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/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/cpython3/Python/clinic/ |
D | bltinmodule.c.h | 589 builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits); 598 PyObject *ndigits = NULL; in builtin_round() local 601 &number, &ndigits)) { in builtin_round() 604 return_value = builtin_round_impl(module, number, ndigits); in builtin_round()
|
/external/python/cpython3/Lib/ |
D | fractions.py | 520 def __round__(self, ndigits=None): argument 525 if ndigits is None: 536 shift = 10**abs(ndigits) 540 if ndigits > 0:
|
D | numbers.py | 189 def __round__(self, ndigits=None): argument
|
/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/Doc/library/ |
D | fractions.rst | 159 __round__(ndigits) 163 nearest multiple of ``Fraction(1, 10**ndigits)`` (logically, if 164 ``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 | 3196 unsigned int ndigits = 0, first = 16 /* flag value */; 3204 digits[ndigits++] = (char)(48 + num); 3209 first = ndigits; 3213 if (ndigits > 0) 3215 while (ndigits > 5) *ascii++ = digits[--ndigits]; 3228 while (ndigits < i) *ascii++ = 48, --i; 3229 while (ndigits >= first) *ascii++ = digits[--ndigits];
|
/external/libpng/ |
D | png.c | 3259 unsigned int ndigits = 0, first = 16 /* flag value */; 3267 digits[ndigits++] = (char)(48 + num); 3272 first = ndigits; 3276 if (ndigits > 0) 3278 while (ndigits > 5) *ascii++ = digits[--ndigits]; 3291 while (ndigits < i) 3295 while (ndigits >= first) *ascii++ = digits[--ndigits];
|
/external/icu/icu4c/source/i18n/ |
D | plurrule.cpp | 1611 for (int ndigits=0; ndigits<=3; ndigits++) { in decimals() local 1612 double scaledN = n * p10[ndigits]; in decimals() 1614 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()
|