Consts
PyLongBaseSet = {0, 2..36}
- Source Edit
Procs
proc `%`(a, b: PyIntObject): PyObject {.cdecl, ...raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc `//`(a, b: PyIntObject): PyObject {.cdecl, ...raises: [], tags: [RootEffect], forbids: [].}
-
long_div Integer divisionNote: this may returns ZeroDivisionErrorSource Edit
proc divmod(a, b: PyIntObject): tuple[d, m: PyIntObject] {....raises: [ValueError], tags: [RootEffect], forbids: [].}
- Source Edit
proc divmodNonZero(a, b: PyIntObject): tuple[d, m: PyIntObject] {....raises: [], tags: [RootEffect], forbids: [].}
- export for builtins.divmod Source Edit
proc floorDivNonZero(a, b: PyIntObject): PyIntObject {....raises: [], tags: [RootEffect], forbids: [].}
-
long_div Integer division
assuming b is non-zero
Source Edit proc format(i: PyIntObject; base: uint8; s: var string): PyBaseErrorObject {. ...raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc format_binary(a: PyIntObject; base: uint8; alternate: bool; v: var string): PyBaseErrorObject {. ...raises: [], tags: [RootEffect], forbids: [].}
- long_format_binary Source Edit
proc fromStr[C: char | Rune](s: openArray[C]): PyIntObject {. ...raises: [ValueError].}
- This ignores sys.flags.int_max_str_digits Source Edit
proc fromStr[C: char | Rune](s: openArray[C]; res: var PyIntObject): int
- with base = 0 (a.k.a. support prefix like 0b) and ignore sys.flags.int_max_str_digits Source Edit
proc fromStr[C: char](res: var PyIntObject; s: openArray[C]; nParsed: var int): PyBaseErrorObject
- Source Edit
proc fromStr[C: char](res: var PyIntObject; s: openArray[C]; nParsed: var int; base: int): PyBaseErrorObject
- Source Edit
proc newPyInt[C: char](smallInt: C): PyIntObject
- Source Edit
proc newPyInt[C: Rune | char](str: openArray[C]): PyIntObject
- Source Edit
proc pow(a, b: PyIntObject): PyIntObject {....raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc PyLong_FromString[C: char](s: openArray[C]; nParsed: var int; base: int = 10): PyObject
- Source Edit
proc toStringCheckThreshold(a: PyIntObject; v: var string): PyBaseErrorObject {. ...raises: [], tags: [RootEffect], forbids: [].}
- this respects sys.flags.int_max_str_digits Source Edit
Methods
method `$`(i: PyIntObject): string {....raises: [], tags: [RootEffect], forbids: [].}
- this ignores sys.flags.int_max_str_digits, and may raises OverflowDefect if i contains too many digits Source Edit
Templates
template retInvIntCall(strObj: PyObject; base: SomeInteger) {.dirty.}
- inner Source Edit
Exports
-
newPyIntSimple, digitPyLong_DECIMAL_BASE, toFloat, frexp, PyIntObject, ofPyIntObject, toFloat, negate, newPyIntFromPtr, newPyInt, newPyInt, setSignNegative, newPyInt, negative, toFloat, pyIntObjectType, zero, newPyInt, newPyIntFromPtr, ofExactPyIntObject, PyLong_DECIMAL_BASE, positive, PyLong_SHIFT, flipSign, PyLong_DECIMAL_SHIFT, numbits, bit_count, bit_length, digitCount, flipSign, setSignNegative, positive, zero, negative, negate, ==, <, abs, +, -, -, *, <, PyLong_AsSsize_t, toFloat, toFloat, Digit, newPyIntFromPtr, absToUInt, toIntOrRetOF, hash, frexp, pyIntObjectType, toFloat, TwoDigits, zero, newPyInt, flipSign, SDigit, bit_count, PyLong_SHIFT, toInt, digitPyLong_DECIMAL_BASE, toUInt, newPyIntFromPtr, newPyInt, truncate, PyIntObject, PY_INT_MAX_STR_DIGITS_THRESHOLD, ofExactPyIntObject, PyLong_DECIMAL_BASE, positive, toInt, newPyIntSimple, numbits, PyLong_AsSize_t, negate, newPyInt, toSomeSignedInt, absToUInt, bit_length, toUInt, PyLong_AsSize_t, IntSign, PyLong_DECIMAL_SHIFT, ofPyIntObject, PY_INT_DEFAULT_MAX_STR_DIGITS, asLongAndOverflow, toSomeUnsignedInt, newPyInt, PyLong_AsSsize_t, setSignNegative, digitCount, PyInt_OverflowCType, toSomeSignedIntUnsafe, digitBits, negative, PY_INT_MAX_STR_DIGITS_THRESHOLD, PY_INT_DEFAULT_MAX_STR_DIGITS, pyIntZero, pyIntOne, pyIntTen