num-bigint-dig/README.md

64 lines
2.2 KiB
Markdown
Raw Normal View History

# num-bigint
2014-09-23 16:27:05 -04:00
[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint)
[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint)
2018-05-14 13:39:35 -07:00
![minimum rustc 1.15](https://img.shields.io/badge/rustc-1.15+-red.svg)
[![Travis status](https://travis-ci.org/rust-num/num-bigint.svg?branch=master)](https://travis-ci.org/rust-num/num-bigint)
2017-07-25 00:16:07 +02:00
Big integer types for Rust, `BigInt` and `BigUint`.
2014-12-23 09:54:56 -08:00
2014-09-23 16:27:05 -04:00
## Usage
Add this to your `Cargo.toml`:
```toml
2014-11-20 15:07:56 -05:00
[dependencies]
2018-05-14 13:39:35 -07:00
num-bigint = "0.2"
2014-09-23 16:27:05 -04:00
```
and this to your crate root:
```rust
extern crate num_bigint;
2014-09-23 16:27:05 -04:00
```
## Features
The `std` crate feature is mandatory and enabled by default. If you depend on
`num-bigint` with `default-features = false`, you must manually enable the
`std` feature yourself. In the future, we hope to support `#![no_std]` with
the `alloc` crate when `std` is not enabled.
Implementations for `i128` and `u128` are only available with Rust 1.26 and
later. The build script automatically detects this, but you can make it
mandatory by enabling the `i128` crate feature.
2018-02-07 22:42:51 -08:00
## Releases
Release notes are available in [RELEASES.md](RELEASES.md).
## Compatibility
2018-05-14 13:39:35 -07:00
The `num-bigint` crate is tested for rustc 1.15 and greater.
2018-02-09 12:43:30 -08:00
## Alternatives
While `num-bigint` strives for good performance in pure Rust code, other
crates may offer better performance with different trade-offs. The following
table offers a brief comparison to a few alternatives.
| Crate | License | Min rustc | Implementation |
| :--------------- | :------------- | :-------- | :------------- |
2018-05-14 13:39:35 -07:00
| **`num-bigint`** | MIT/Apache-2.0 | 1.15 | pure rust |
2018-02-09 12:43:30 -08:00
| [`ramp`] | Apache-2.0 | nightly | rust and inline assembly |
2018-02-09 14:05:34 -08:00
| [`rug`] | LGPL-3.0+ | 1.18 | bundles [GMP] via [`gmp-mpfr-sys`] |
| [`rust-gmp`] | MIT | stable? | links to [GMP] |
| [`apint`] | MIT/Apache-2.0 | 1.26 | pure rust (unfinished) |
2018-02-09 12:43:30 -08:00
[GMP]: https://gmplib.org/
[`gmp-mpfr-sys`]: https://crates.io/crates/gmp-mpfr-sys
[`rug`]: https://crates.io/crates/rug
[`rust-gmp`]: https://crates.io/crates/rust-gmp
[`ramp`]: https://crates.io/crates/ramp
[`apint`]: https://crates.io/crates/apint