ibig
A big integer library with good performance.
The library implements efficient large integer arithmetic in pure Rust.
The two integer types are UBig
(for unsigned integers) and IBig
(for signed integers).
Modular arithmetic is supported by the module modular
.
Examples
use ;
let a = ubig!;
let b = ubig!;
let c = ibig!;
let d: UBig = "15033211231241234523452345345787".parse?;
let e = 2 * &b + 1;
let f = a * b.pow;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
let ring = new;
let x = ring.from;
let y = ring.from;
assert_eq!;
Optional dependencies
std
(default): forstd::error::Error
.num-traits
(default): integral traits.rand
(default): random number generation.serde
: serialization and deserialization.
Benchmarks
Benchmarks contains a quick benchmark of Rust big integer libraries.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.