No description
Find a file
dependabot[bot] 115ae9cc49
Bump actions/checkout from 4 to 5 (#146)
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>
2025-08-18 17:12:49 +02:00
.github Bump actions/checkout from 4 to 5 (#146) 2025-08-18 17:12:49 +02:00
examples feat: add Pollard's p-1 example (#138) 2023-12-01 13:24:27 +01:00
src Fix shl and shr (#134) 2023-07-28 21:09:57 +02:00
tests Implement bitwise operations for negative numbers (#111) 2022-11-03 09:48:40 +01:00
.gitignore Don't use std/unittest for the tests (#58) 2022-01-01 08:17:38 +01:00
bigints.nimble bump version number 2023-05-18 16:55:33 +02:00
license.txt Add license.txt (fixes #15) 2019-03-19 11:54:41 +01:00
readme.md Update documentation link (#136) 2023-07-24 06:33:14 +02:00

Pure BigInts for Nim

test

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 BigInt from all standard integer types (initBigInt)
  • comparisons (<, <=, ==)
  • addition, negation and subtraction (+, -, += -=)
  • multiplication (*, *=)
  • bit shifts (shr, shl)
  • bitwise not, and, or and xor (behave as if negative numbers were represented in 2's complement)
  • integer division and modulo operation (div, mod)
  • conversion of BigInt from/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.