Skip to content

planetis-m/bigints

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 and, or and xor (limited to non-negative numbers)
  • 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
  • bitwise not operation is not implemented
  • arithmetical 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://nimdocs.com/nim-lang/bigints/bigints.html

About

BigInts for Nim

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Nim 100.0%