dashu-int

Crates.iodashu-int
lib.rsdashu-int
version0.4.1
sourcesrc
created_at2022-07-10 07:17:32.612187
updated_at2024-01-12 13:25:56.98816
descriptionA big integer library with good performance
homepagehttps://github.com/cmpute/dashu
repositoryhttps://github.com/cmpute/dashu
max_upload_size
id622990
size762,098
Jacob Zhong (cmpute)

documentation

https://docs.rs/dashu-int

README

dashu-int

Arbitrary precision integer implementation as a part of the dashu library. See Docs.rs for the full documentation.

The majority of the code is based on the ibig crate. The modification notice based on the the original ibig repo is included in the NOTICE file.

Features

  • Supports no_std and written in pure Rust.
  • Support for both unsigned and signed big integers.
  • Small integers are inlined on stack with specialized algorithms.
  • Efficient implementation for basic arithmetic operations (+,-,*,/,%,<<,>>).
  • Support advanced arithmetic operations including pow, ilog, gcd, gcd_ext.
  • Bit operations for signed big integers follow the 2's complement rule.
  • Efficient implementation for modular arithmetics (e.g. modular powering and inverse).
  • Efficient integer parsing and printing with base 2~36.
  • Developer friendly debug printing for big integers.
  • Direct access to underlying machine word array.

Optional dependencies

  • std (default): for std::error::Error.
  • num-traits (default): integral traits.
  • rand (default): random number generation.
  • serde: serialization and deserialization.

Performance

See the built-in benchmark.

License

See the top-level readme.

Commit count: 285

cargo fmt