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:
BigInt
from all standard integer types (initBigInt
)<
, <=
, ==
)+
, -
, +=
-=
)*
, *=
)shr
, shl
)not
, and
, or
and xor
(behave as if negative numbers were represented in 2's complement)div
, mod
)BigInt
from/to strings supporting bases from 2 to 36 (initBigInt
, $
)inc
, dec
, countdown
, countup
, ..
, ..<
)The documentation is available at https://nim-lang.github.io/bigints.