Home
last modified time | relevance | path

Searched refs:ndigits (Results 1 – 25 of 37) sorted by relevance

12

/external/python/cpython3/Modules/_decimal/tests/
Dranddec.py127 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/syslinux/com32/lib/
Dvsnprintf.c55 int ndigits = 0, nchars; in format_int() local
71 ndigits++; in format_int()
77 if (prec < ndigits + 1) in format_int()
78 prec = ndigits + 1; in format_int()
81 if (ndigits < prec) { in format_int()
82 ndigits = prec; /* Mandatory number padding */ in format_int()
84 ndigits = 1; /* Zero still requires space */ in format_int()
91 tickskip = ndigits; /* No tick marks */ in format_int()
95 ndigits += (ndigits - 1) / tickskip; in format_int()
98 nchars = ndigits; in format_int()
[all …]
/external/python/cpython3/Objects/
Dfloatobject.c915 double_round(double x, int ndigits) { in double_round() argument
926 buf = _Py_dg_dtoa(x, 3, ndigits, &decpt, &sign, &buf_end); in double_round()
973 double_round(double x, int ndigits) { in double_round() argument
975 if (ndigits >= 0) { in double_round()
976 if (ndigits > 22) { in double_round()
979 pow1 = pow(10.0, (double)(ndigits-22)); in double_round()
983 pow1 = pow(10.0, (double)ndigits); in double_round()
992 pow1 = pow(10.0, (double)-ndigits); in double_round()
1002 if (ndigits >= 0) in double_round()
1026 Py_ssize_t ndigits; in float_round() local
[all …]
Dlongobject.c236 int ndigits = 0; in PyLong_FromLong() local
281 ++ndigits; in PyLong_FromLong()
284 v = _PyLong_New(ndigits); in PyLong_FromLong()
287 Py_SIZE(v) = ndigits*sign; in PyLong_FromLong()
305 int ndigits = 0; in PyLong_FromUnsignedLong() local
312 ++ndigits; in PyLong_FromUnsignedLong()
315 v = _PyLong_New(ndigits); in PyLong_FromUnsignedLong()
318 Py_SIZE(v) = ndigits; in PyLong_FromUnsignedLong()
717 Py_ssize_t ndigits; in _PyLong_NumBits() local
721 ndigits = Py_ABS(Py_SIZE(v)); in _PyLong_NumBits()
[all …]
/external/python/cpython2/Objects/
Dfloatobject.c1092 _Py_double_round(double x, int ndigits) { in _Py_double_round() argument
1102 if (ndigits == 0) { in _Py_double_round()
1148 if (val == -ndigits-1) { in _Py_double_round()
1149 if (ndigits >= 0) in _Py_double_round()
1151 else if (ndigits >= -FIVE_POW_LIMIT) { in _Py_double_round()
1154 for (i=0; i < -ndigits; i++) in _Py_double_round()
1166 buf = _Py_dg_dtoa(x, 3, ndigits+halfway_case, &decpt, &sign, &buf_end); in _Py_double_round()
1181 assert(buflen - decpt == ndigits+1); in _Py_double_round()
1236 _Py_double_round(double x, int ndigits) { in _Py_double_round() argument
1238 if (ndigits >= 0) { in _Py_double_round()
[all …]
Dlongobject.c106 int ndigits = 0; in PyLong_FromLong() local
126 ++ndigits; in PyLong_FromLong()
129 v = _PyLong_New(ndigits); in PyLong_FromLong()
132 v->ob_size = 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/syslinux/com32/lib/sys/
Dxserial_write.c54 static int ndigits; in __xserial_write() local
71 ndigits = ch; in __xserial_write()
93 if (--ndigits == 0) { in __xserial_write()
/external/python/cpython3/Python/
Ddtoa.c1445 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 …]
Dbltinmodule.c2054 PyObject *ndigits = NULL; in builtin_round() local
2059 kwlist, &number, &ndigits)) in builtin_round()
2076 if (ndigits == NULL || ndigits == Py_None) in builtin_round()
2079 result = PyObject_CallFunctionObjArgs(round, ndigits, NULL); in builtin_round()
/external/python/cpython2/Python/
Ddtoa.c1518 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 …]
Dbltinmodule.c2179 Py_ssize_t ndigits; in builtin_round() local
2188 ndigits = 0; in builtin_round()
2192 ndigits = PyNumber_AsSsize_t(o_ndigits, NULL); in builtin_round()
2193 if (ndigits == -1 && PyErr_Occurred()) in builtin_round()
2206 if (ndigits > NDIGITS_MAX) in builtin_round()
2209 else if (ndigits < NDIGITS_MIN) in builtin_round()
2215 return _Py_double_round(x, (int)ndigits); in builtin_round()
/external/python/cpython3/Lib/
Dfractions.py520 def __round__(self, ndigits=None): argument
525 if ndigits is None:
536 shift = 10**abs(ndigits)
540 if ndigits > 0:
Dnumbers.py189 def __round__(self, ndigits=None): argument
/external/python/cpython2/Include/
Ddtoa.h7 PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
Dfloatobject.h133 PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
/external/python/cpython3/Include/
Ddtoa.h8 PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
/external/python/cpython3/Doc/library/
Dfractions.rst159 __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/
Dunames.cpp453 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 += ndigits; in getExtName()
/external/libpng/contrib/tools/
Dpngfix.c188 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/
Dtest_long.py98 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/
Dpng.c3196 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/
Dpng.c3259 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/
Dplurrule.cpp1572 for (int ndigits=0; ndigits<=3; ndigits++) { in decimals() local
1573 double scaledN = n * p10[ndigits]; in decimals()
1575 return ndigits; in decimals()
/external/python/cpython3/Lib/test/
Dtest_long.py123 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/
Dprtime.cc791 int ndigits = end - rest; in PR_ParseTimeString() local
792 while (ndigits++ < 6) in PR_ParseTimeString()

12