Lines Matching refs:ndigits
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()
501 assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); in _PyLong_NumBits()
502 if (ndigits > 0) { in _PyLong_NumBits()
503 digit msd = v->ob_digit[ndigits - 1]; in _PyLong_NumBits()
505 result = (ndigits - 1) * PyLong_SHIFT; in _PyLong_NumBits()
506 if (result / PyLong_SHIFT != (size_t)(ndigits - 1)) in _PyLong_NumBits()
531 Py_ssize_t ndigits; /* number of Python long digits */ in _PyLong_FromByteArray() local
584 ndigits = (numsignificantbytes * 8 + PyLong_SHIFT - 1) / PyLong_SHIFT; in _PyLong_FromByteArray()
585 v = _PyLong_New(ndigits); in _PyLong_FromByteArray()
614 assert(idigit < ndigits); in _PyLong_FromByteArray()
624 assert(idigit < ndigits); in _PyLong_FromByteArray()
640 Py_ssize_t ndigits; /* |v->ob_size| */ in _PyLong_AsByteArray() local
652 ndigits = -(Py_SIZE(v)); in _PyLong_AsByteArray()
661 ndigits = Py_SIZE(v); in _PyLong_AsByteArray()
678 assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); in _PyLong_AsByteArray()
683 for (i = 0; i < ndigits; ++i) { in _PyLong_AsByteArray()
697 if (i == ndigits - 1) { in _PyLong_AsByteArray()
851 int ndigits = 0; in PyLong_FromLongLong() local
870 ++ndigits; in PyLong_FromLongLong()
873 v = _PyLong_New(ndigits); in PyLong_FromLongLong()
876 Py_SIZE(v) = negative ? -ndigits : ndigits; in PyLong_FromLongLong()
893 int ndigits = 0; in PyLong_FromUnsignedLongLong() local
898 ++ndigits; in PyLong_FromUnsignedLongLong()
901 v = _PyLong_New(ndigits); in PyLong_FromUnsignedLongLong()
904 Py_SIZE(v) = ndigits; in PyLong_FromUnsignedLongLong()
4153 Py_ssize_t ndigits, msd_bits = 0; in long_bit_length() local
4159 ndigits = ABS(Py_SIZE(v)); in long_bit_length()
4160 if (ndigits == 0) in long_bit_length()
4163 msd = v->ob_digit[ndigits-1]; in long_bit_length()
4170 if (ndigits <= PY_SSIZE_T_MAX/PyLong_SHIFT) in long_bit_length()
4171 return PyInt_FromSsize_t((ndigits-1)*PyLong_SHIFT + msd_bits); in long_bit_length()
4174 result = (PyLongObject *)PyLong_FromSsize_t(ndigits - 1); in long_bit_length()