src/intobject

Search:
Group by:
Source   Edit  

intobject

![Test](https://github.com/nimpylib/intobject/actions/workflows/ci.yml/badge.svg) ![Docs](https://github.com/nimpylib/intobject/actions/workflows/docs.yml/badge.svg) <!--![Commits](https://img.shields.io/github/last-commit/nimpylib/intobject?style=flat)-->

---

Docs

big integer library for Nim, a.k.a. arbirary precision ineger or bignums

This library is initially used for implementing python's int (a.k.a. npyhon's)

why not use existing library?

python's int object has too many methods/relative functions, none of existing supports all as of now.

For example, pkg/bigints lacks int.to_bytes, int.from_bytes

Features

  • support weird targets (NimScript and JS)
  • support Compile-Time usage
  • mix Nim builtin integers (SomeInteger) e.g. 1'iobj + 3 == 4

Exports

HasLdExp, frexp, isEven, flipSign, isPositive, isZero, setSignNegative, isNegative, isOdd, negate, 'iobj, round, powNatural, newInt, >=%, intTen, Digit, ==, fromStrWithValidBase, pow, toIntOrRetOF, >%, floormodNonZero, toStringCheckThreshold, $, PY_INT_DEFAULT_MAX_STR_DIGITS, asLongAndOverflow, -, newInt, TwoDigits, absToUInt, isEven, flipSign, ceilDiv, SDigit, bit_count, floormod, PyLong_SHIFT, PyLong_DECIMAL_BASE, pow, SomeUnsignedIntSmallerThanTwoDigits, powMod, toUInt, <=, newIntFromPtr, divmodNear, floordivNonZero, intOne, truncate, div, mod, SomeIntegerOrObj, PY_INT_MAX_STR_DIGITS_THRESHOLD, format, intZero, newInt, toInt, intTwo, hash, divmodNonZero, toInt, toFloat, toFloat, format_binary, numbits, isNil, divrem, isOdd, fromStr, sign, parseIntObject, abs, toSomeSignedInt, <=%, newInt, bit_length, newIntSimple, byteCount, //, toString, toUInt, IntObjectFromStrError, isNegative, mod, toFloat, %, divRem, IntSign, +, newIntFromPtr, powPos, mod, PyLong_DECIMAL_SHIFT, fromStr, !=%, -, parseInt, negate, IntObject, <, ==%, toSomeUnsignedInt, isZero, setSignNegative, newInt, digitCount, floordiv, newInt, isPositive, newIntFromNormalFloat, absToUInt, toInt, toSomeSignedIntUnsafe, PyLongBaseSet, divmod, <%, digitBits, pow, *, sign, ceilDiv, or, shr, and, private_mixOpPyWithNim_with_div_mod_bitwise, shl, //, private_gen_mix, -, or, shr, <, ==, <=, +, ==, and, floormod, pow, %, <=, floormod, shl, floordiv, div, divmod, <, *, div, -, floordiv, divmod, xor, ceilDiv, %, //, xor, +, pow, private_mixOpPyWithNim, *, mod, mod, -=, inc, %=, inc, +=, dec, //=, *=, dec, shl, shr, not, shl, isNil, sign, shr, sign, newInt, newIntFromPtr, newInt, IntObject, newInt, and, newIntSimple, xor, SomeIntegerOrObj, newInt, PyLong_DECIMAL_BASE, or, newIntFromPtr, PyLong_SHIFT, PyLong_DECIMAL_SHIFT, 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, private_gen_formatValue_impl, IntObjectFormatOverflowError, formatValue, formatValue, fastLog2, pred, .., succ, gcd, lcm, SDigit, isNil, sign, newInt, sign, newInt, newIntFromPtr, newInt, IntObject, newInt, newIntFromPtr, newIntSimple, truncate, SomeIntegerOrObj, Digit, TwoDigits, PyLong_DECIMAL_BASE, digitBits, IntSign, PyLong_SHIFT, PyLong_DECIMAL_SHIFT, byteCount, numbits, bit_count, bit_length, digitCount, parseByteOrder, newInt, IntObjectToBytesError, tochars, tobytes, to_bytes, tochars, newInt, tobytes, randbits, randbits