/third_party/python/Modules/_decimal/tests/ |
H A 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( [all...] |
/third_party/python/Objects/ |
H A D | floatobject.c | 953 10**-ndigits; here ndigits is within reasonable bounds (typically, -308 <= 954 ndigits <= 323). Returns a Python float, or sets a Python error and 962 double_round(double x, int ndigits) { in double_round() argument 973 buf = _Py_dg_dtoa(x, 3, ndigits, &decpt, &sign, &buf_end); in double_round() 1020 double_round(double x, int ndigits) { in double_round() argument 1022 if (ndigits >= 0) { in double_round() 1023 if (ndigits > 22) { in double_round() 1025 pow1*pow2 ~= pow(10.0, ndigits) might overflow */ in double_round() 1026 pow1 = pow(10.0, (double)(ndigits in double_round() 1084 Py_ssize_t ndigits; float___round___impl() local 1318 Py_ssize_t length, ndigits, fdigits, i; float_fromhex() local [all...] |
H A D | longobject.c | 155 Py_ssize_t ndigits = size ? size : 1; in _PyLong_New() local 162 ndigits*sizeof(digit)); in _PyLong_New() 235 Py_ssize_t ndigits = 2; in _PyLong_FromLarge() local 237 ++ndigits; in _PyLong_FromLarge() 240 PyLongObject *v = _PyLong_New(ndigits); in _PyLong_FromLarge() 243 Py_SET_SIZE(v, ndigits * sign); in _PyLong_FromLarge() 292 int ndigits; in PyLong_FromLong() local 306 ndigits = 2; in PyLong_FromLong() 308 ++ndigits; in PyLong_FromLong() 313 v = _PyLong_New(ndigits); in PyLong_FromLong() 789 Py_ssize_t ndigits; _PyLong_NumBits() local 822 Py_ssize_t ndigits; /* number of Python int digits */ _PyLong_FromByteArray() local 931 Py_ssize_t ndigits; /* |v->ob_size| */ _PyLong_AsByteArray() local 1119 int ndigits; PyLong_FromLongLong() local 1161 int ndigits = 0; PyLong_FromSsize_t() local 5594 PyObject *temp, *result, *ndigits; int___round___impl() local 5692 Py_ssize_t ndigits; int_bit_length_impl() local 5770 Py_ssize_t ndigits = Py_ABS(Py_SIZE(z)); int_bit_count_impl() local [all...] |
/third_party/python/Python/ |
H A D | dtoa.c | 1450 size_t ndigits, fraclen; in _Py_dg_strtod() local 1476 digit string. ndigits will be the total number of digits ignoring in _Py_dg_strtod() 1481 ndigits = s - s1; in _Py_dg_strtod() 1487 if (!ndigits) { in _Py_dg_strtod() 1498 ndigits += s - s1; in _Py_dg_strtod() 1503 ndigits gives the total number of digits ignoring leading zeros. A in _Py_dg_strtod() 1505 if (!ndigits && !lz) { in _Py_dg_strtod() 1511 /* Range check ndigits and fraclen to make sure that they, and values in _Py_dg_strtod() 1513 if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { in _Py_dg_strtod() 1518 nd = (int)ndigits; in _Py_dg_strtod() 2248 _Py_dg_dtoa(double dd, int mode, int ndigits, int *decpt, int *sign, char **rve) _Py_dg_dtoa() argument [all...] |
H A D | bltinmodule.c | 2306 ndigits: object = None 2310 The return value is an integer if ndigits is omitted or None. Otherwise 2311 the return value has the same type as the number. ndigits may be negative. 2315 builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits) in builtin_round_impl() argument 2334 if (ndigits == Py_None) in builtin_round_impl() 2337 result = PyObject_CallOneArg(round, ndigits); in builtin_round_impl()
|
/third_party/FreeBSD/contrib/gdtoa/ |
H A D | gdtoa.h | 106 extern char* dtoa ANSI((double d, int mode, int ndigits, int *decpt, 109 int mode, int ndigits, int *decpt, char **rve));
|
H A D | gdtoaimp.h | 609 extern char *dtoa ANSI((double d, int mode, int ndigits, 613 int mode, int ndigits, int *decpt, char **rve));
|
/third_party/python/Lib/ |
H A D | fractions.py | 620 def __round__(self, ndigits=None): 621 """round(self, ndigits) 625 if ndigits is None: 636 shift = 10**abs(ndigits) 640 if ndigits > 0:
|
H A D | numbers.py | 189 def __round__(self, ndigits=None): 190 """Rounds self to ndigits decimal places, defaulting to 0. 192 If ndigits is omitted or None, returns an Integral, otherwise
|
H A D | typing.py | 2835 def __round__(self, ndigits: int = 0) -> T_co:
|
/third_party/python/Python/clinic/ |
H A D | bltinmodule.c.h | 895 "round($module, /, number, ndigits=None)\n" 900 "The return value is an integer if ndigits is omitted or None. Otherwise\n" 901 "the return value has the same type as the number. ndigits may be negative."); 907 builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits); 913 static const char * const _keywords[] = {"number", "ndigits", NULL}; in builtin_round() 918 PyObject *ndigits = Py_None; in builtin_round() local 928 ndigits = args[1]; in builtin_round() 930 return_value = builtin_round_impl(module, number, ndigits); in builtin_round()
|
/third_party/icu/icu4c/source/common/ |
H A 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()
|
/third_party/node/deps/icu-small/source/common/ |
H A 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()
|
/third_party/skia/third_party/externals/icu/source/common/ |
H A 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()
|
/third_party/skia/third_party/externals/libpng/contrib/tools/ |
H A 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() 353 /* The shift may reduce 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 [all...] |
/third_party/skia/third_party/externals/libpng/ |
H A D | png.c | 3253 unsigned int ndigits = 0, first = 16 /* flag value */; in png_ascii_from_fixed() local 3261 digits[ndigits++] = (char)(48 + num); in png_ascii_from_fixed() 3266 first = ndigits; in png_ascii_from_fixed() 3270 if (ndigits > 0) in png_ascii_from_fixed() 3272 while (ndigits > 5) *ascii++ = digits[--ndigits]; in png_ascii_from_fixed() 3273 /* The remaining digits are fractional digits, ndigits is '5' or in png_ascii_from_fixed() 3281 /* ndigits may be <5 for small numbers, output leading zeros in png_ascii_from_fixed() 3282 * then ndigits digits to first: in png_ascii_from_fixed() 3285 while (ndigits < in png_ascii_from_fixed() [all...] |
/third_party/icu/icu4c/source/i18n/ |
H A D | plurrule.cpp | 1809 for (int ndigits=0; ndigits<=3; ndigits++) { 1810 double scaledN = n * p10[ndigits]; 1812 return ndigits;
|
/third_party/node/deps/icu-small/source/i18n/ |
H A D | plurrule.cpp | 1813 for (int ndigits=0; ndigits<=3; ndigits++) { 1814 double scaledN = n * p10[ndigits]; 1816 return ndigits;
|
/third_party/skia/third_party/externals/icu/source/i18n/ |
H A D | plurrule.cpp | 1804 for (int ndigits=0; ndigits<=3; ndigits++) { 1805 double scaledN = n * p10[ndigits]; 1807 return ndigits;
|
/third_party/python/Lib/test/ |
H A D | test_long.py | 117 # Get quasi-random long consisting of ndigits digits (in base BASE). 123 def getran(self, ndigits): 124 self.assertGreater(ndigits, 0) 125 nbits_hi = ndigits * SHIFT 144 # Get random long consisting of ndigits random digits (relative to base 147 def getran2(ndigits): 149 for i in range(ndigits):
|
H A D | test_float.py | 941 for x in round(1.23), round(1.23, None), round(1.23, ndigits=None): 944 for x in round(1.78), round(1.78, None), round(1.78, ndigits=None):
|
H A D | test_builtin.py | 1539 self.assertEqual(round(number=-8.0, ndigits=-1), -10.0) 1583 # Verify that ndigits=None means the same as passing in no argument
|
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-subzero/lib/Support/ |
H A D | regcomp.c | 651 int ndigits = 0; in p_count() local 655 ndigits++; in p_count() 658 REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); in p_count()
|
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Support/ |
H A D | regcomp.c | 779 int ndigits = 0; in p_count() local 783 ndigits++; in p_count() 786 REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); in p_count()
|