num-integer
num-integer copied to clipboard
Integer trait and functions for Rust
Here is the first method in the new trait. Just sending it across for a quick review before I start adding more. Do you prefer - one pull request, one...
I'd like to contribute a high performance implementation of is_power_of_ten. Is that an appropriate function for this crate?
This PR seeks to solve https://github.com/rust-num/num-integer/issues/2. If merged, I also intend to manually implement these methods more optimally on BigInt and BigUint.
It's very easy to implement the check wrong, most people only check if denominator is 0, but not `i32::MIN / -1`.
This would be a breaking change either way, but `binomial(n, k)` with `n < 0` should either produce `(-1).pow(k) * binomial(k - n - 1, k) = n(n-1)...(n-k +1)/k!` or...
The docs for [Integer::gcd()](https://docs.rs/num-integer/0.1.45/src/num_integer/lib.rs.html#459) state "The result is always non-negative", but this is not the case when calculating the gcd of zero and the minimum value of a signed integer...
This isn't a follow-up to #63, but it's related. I understand that despite [`NonZero`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html) being stable, [its trait-bound](https://doc.rust-lang.org/stable/core/num/trait.ZeroablePrimitive.html) isn't, so nothing should be done WRT that. However, if it does...
Hey there, I wanted to use [kani](https://github.com/model-checking/kani) to verify certain parts of my codebase, which uses this crate (among others). Would this project be open to accept contributions to add...
It looks like the stabilization of https://doc.rust-lang.org/stable/std/primitive.u8.html#method.is_multiple_of causes the tests to fail to compile due to a type mismatch: ``` error[E0308]: mismatched types --> src/lib.rs:1021:50 | 1021 | assert!((0 as...
Having the BITS constant (or a method returning it) available on the Integer trait would be insanely useful.