mirror of
https://github.com/nim-lang/bigints
synced 2026-01-02 07:04:40 +00:00
No description
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|---|---|---|
| .github | ||
| examples | ||
| src | ||
| tests | ||
| .gitignore | ||
| bigints.nimble | ||
| license.txt | ||
| readme.md | ||
Pure BigInts for Nim
This library provides a pure implementation for arbitrary precision integers in Nim.
It can be installed through nimble with:
nimble install https://github.com/nim-lang/bigints
bigints provides a BigInt type and related operations with standard Nim syntax:
- creation of
BigIntfrom all standard integer types (initBigInt) - comparisons (
<,<=,==) - addition, negation and subtraction (
+,-,+=-=) - multiplication (
*,*=) - bit shifts (
shr,shl) - bitwise
not,and,orandxor(behave as if negative numbers were represented in 2's complement) - integer division and modulo operation (
div,mod) - conversion of
BigIntfrom/to strings supporting bases from 2 to 36 (initBigInt,$) - iteration utilities (
inc,dec,countdown,countup,..,..<)
Current limitations and possible enhancements
- not expected to work on 32 bit
- arithmetic operations such as addition, multiplication and division are not optimized for performance (e.g. Karatsuba multiplication is not implemented)
Documentation
The documentation is available at https://nim-lang.github.io/bigints.