Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
benches/ | H | 03-May-2022 | - | 821 | 625 | |
ci/ | H | 03-May-2022 | - | 53 | 32 | |
src/ | H | 03-May-2022 | - | 8,042 | 6,060 | |
tests/ | H | 03-May-2022 | - | 4,741 | 4,140 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 27-Jan-2020 | 74 | 6 | 5 | |
.gitignore | H A D | 02-Nov-2018 | 30 | 5 | 4 | |
.travis.yml | H A D | 27-Jan-2020 | 477 | 31 | 30 | |
Cargo.toml | H A D | 27-Jan-2020 | 1.9 KiB | 82 | 69 | |
Cargo.toml.orig-cargo | H A D | 27-Jan-2020 | 1.4 KiB | 76 | 59 | |
LICENSE-APACHE | H A D | 02-Nov-2018 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 02-Nov-2018 | 1 KiB | 26 | 22 | |
README.md | H A D | 27-Jan-2020 | 2.5 KiB | 77 | 54 | |
RELEASES.md | H A D | 27-Jan-2020 | 6.8 KiB | 167 | 119 | |
bors.toml | H A D | 02-Nov-2018 | 56 | 4 | 3 | |
build.rs | H A D | 27-Jan-2020 | 312 | 15 | 11 |
README.md
1# num-bigint 2 3[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint) 4[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint) 5![minimum rustc 1.15](https://img.shields.io/badge/rustc-1.15+-red.svg) 6[![Travis status](https://travis-ci.org/rust-num/num-bigint.svg?branch=master)](https://travis-ci.org/rust-num/num-bigint) 7 8Big integer types for Rust, `BigInt` and `BigUint`. 9 10## Usage 11 12Add this to your `Cargo.toml`: 13 14```toml 15[dependencies] 16num-bigint = "0.2" 17``` 18 19and this to your crate root: 20 21```rust 22extern crate num_bigint; 23``` 24 25## Features 26 27The `std` crate feature is mandatory and enabled by default. If you depend on 28`num-bigint` with `default-features = false`, you must manually enable the 29`std` feature yourself. In the future, we hope to support `#![no_std]` with 30the `alloc` crate when `std` is not enabled. 31 32Implementations for `i128` and `u128` are only available with Rust 1.26 and 33later. The build script automatically detects this, but you can make it 34mandatory by enabling the `i128` crate feature. 35 36### Random Generation 37 38`num-bigint` supports the generation of random big integers when the `rand` 39feature is enabled. To enable it include rand as 40 41```toml 42rand = "0.5" 43num-bigint = { version = "0.2", features = ["rand"] } 44``` 45 46Note that you must use the version of `rand` that `num-bigint` is compatible 47with: `0.5`. 48 49## Releases 50 51Release notes are available in [RELEASES.md](RELEASES.md). 52 53## Compatibility 54 55The `num-bigint` crate is tested for rustc 1.15 and greater. 56 57## Alternatives 58 59While `num-bigint` strives for good performance in pure Rust code, other 60crates may offer better performance with different trade-offs. The following 61table offers a brief comparison to a few alternatives. 62 63| Crate | License | Min rustc | Implementation | 64| :--------------- | :------------- | :-------- | :------------- | 65| **`num-bigint`** | MIT/Apache-2.0 | 1.15 | pure rust | 66| [`ramp`] | Apache-2.0 | nightly | rust and inline assembly | 67| [`rug`] | LGPL-3.0+ | 1.31 | bundles [GMP] via [`gmp-mpfr-sys`] | 68| [`rust-gmp`] | MIT | stable? | links to [GMP] | 69| [`apint`] | MIT/Apache-2.0 | 1.26 | pure rust (unfinished) | 70 71[GMP]: https://gmplib.org/ 72[`gmp-mpfr-sys`]: https://crates.io/crates/gmp-mpfr-sys 73[`rug`]: https://crates.io/crates/rug 74[`rust-gmp`]: https://crates.io/crates/rust-gmp 75[`ramp`]: https://crates.io/crates/ramp 76[`apint`]: https://crates.io/crates/apint 77