Crates.io | smallbigint |
lib.rs | smallbigint |
version | 1.1.0 |
source | src |
created_at | 2020-02-19 23:11:49.538293 |
updated_at | 2020-12-13 19:17:38.297874 |
description | Big integer types that have a small on-stack representation for small values. Uses num-bigint internally. |
homepage | |
repository | https://github.com/rusty-plasma/smallbigint |
max_upload_size | |
id | 210750 |
size | 175,498 |
Two types, Uint
and Int
, like smallvec
for big integers. Anything that fits in 32 bits stays on the stack. Numbers that don't fit are stored in a Box<num_bigint::BigUint>
/ Box<num_bigint::BigInt>
.
On 64-bit architectures, by default we use unsafe
to compress the types to 8 bytes, exploiting pointer alignment. This behavior is triggered by the unsafe-opt
feature, which is enabled by default.
Most important numeric traits have been implemented. Here are some that aren't yet; pull requests are welcome!
num_traits::Num
, num_traits::Signed
, num_traits::Unsigned
, num_integer::Integer
, num_integer::Roots
, std::iter::Product
, std::iter::Sum
, num_traits::pow::Pow
BigInt
, BigUint
num_bigint::{ToBigInt, ToBigUint}
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.