Types
IntObjectFromStrError {.pure.} = enum Ok, InvalidBase = "int() arg 2 must be >= 2 and <= 36", InvalidLiteral = "invalid literal for int() with base", ExceedsMaxStrDigits = "exceeds maximum string digits allowed in int() conversion"
- Source Edit
Consts
PyLongBaseSet = {0, 2..36}
- Source Edit
Procs
proc fromStr[C: char](res: var IntObject; s: openArray[C]; nParsed: var int): IntObjectFromStrError
- Source Edit
proc fromStr[C: char](res: var IntObject; s: openArray[C]; nParsed: var int; base: int): IntObjectFromStrError
- Source Edit
proc fromStrWithValidBase[C: char](res: var IntObject; s: openArray[C]; nParsed: var int; base: int): IntObjectFromStrError
- Source Edit
proc newIntFromNormalFloat(dval: float): IntObject {....raises: [], tags: [], forbids: [].}
- PyLong_FromDouble, but assumes dval is normal (not inf or nan) Source Edit
proc parseIntObject[C: char | Rune](s: openArray[C]): IntObject {. ...raises: [ValueError].}
- This ignores get_intobject_state().max_str_digits Source Edit
Exports
-
isNil, sign, newInt, sign, newInt, newIntFromPtr, newInt, IntObject, newInt, newIntFromPtr, newIntSimple, SomeIntegerOrObj, PyLong_DECIMAL_BASE, PyLong_SHIFT, PyLong_DECIMAL_SHIFT, byteCount, numbits, bit_count, bit_length, digitCount, isEven, flipSign, isPositive, isZero, setSignNegative, isNegative, isOdd, negate, *, !=%, abs, intZero, -, -, <%, intTen, <, ==, <=, ==%, +, intTwo, <=%, >=%, intOne, >%, numbits, isNil, isOdd, PY_INT_MAX_STR_DIGITS_THRESHOLD, sign, toIntOrRetOF, toSomeSignedInt, newInt, bit_length, newIntSimple, byteCount, toUInt, toInt, newInt, TwoDigits, isNegative, absToUInt, isEven, flipSign, SDigit, IntSign, bit_count, isZero, PyLong_SHIFT, toInt, PyLong_DECIMAL_SHIFT, newIntFromPtr, toUInt, sign, PY_INT_DEFAULT_MAX_STR_DIGITS, newInt, asLongAndOverflow, toSomeUnsignedInt, newIntFromPtr, setSignNegative, IntObject, newInt, hash, digitCount, truncate, SomeIntegerOrObj, isPositive, Digit, absToUInt, toInt, toSomeSignedIntUnsafe, PyLong_DECIMAL_BASE, digitBits, negate, SomeUnsignedIntSmallerThanTwoDigits, floordiv, mod, divmod, floordivNonZero, div, //, divRem, divrem, mod, ceilDiv, %, floormod, divmodNonZero, floormodNonZero, mod, powMod, powPos, powNatural, pow, pow, divmodNear, round, pow, $, toFloat, toFloat, toFloat, format_binary, format, toStringCheckThreshold, toString, PY_INT_MAX_STR_DIGITS_THRESHOLD, PY_INT_DEFAULT_MAX_STR_DIGITS, intZero, intOne, intTen