num-integer
                                
                                 num-integer copied to clipboard
                                
                                    num-integer copied to clipboard
                            
                            
                            
                        Integer trait and functions for Rust
This implements the extended Euclidean algorithm, the modular inverse and modular exponentiation. * This is taken from https://github.com/vks/discrete-log and uses the traits from `num-traits`. * To avoid break backwards compatibility,...
_From @ejmahler on June 30, 2016 22:59_ In num_integer, I see an implementation of gcd. I would like to implement some related number theory functions: [modular exponentiation](https://en.wikipedia.org/wiki/Modular_exponentiation), [extended euclid's algorithm](https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm),...
Optimized to use cheap shifts and adds rather than multiplications and divisions for finding the greated common divisor and Bezout coefficients.
Currently, running ` BigUint::zero().is_multiple_of(&BigUint::zero())` panics, since the implementation attemps to perform a modular division https://github.com/rust-num/num-integer/blob/d5267dc842ea730b87cb4610f7ff39adacd81a2f/src/lib.rs#L888 However, 0 is indeed a multiple of 0 and as such true should be returned....
Resolves #41.
The doc comment of `Integer::divides` is `Deprecated, use is_multiple_of instead.` but it does not have `deprecated` attribute.
This code fails to get the y value, with the error 'attempt to subtract with overflow'. ```rust #[test] fn extended_gcd_test(){ use num_integer::Integer; let _x = 10.extended_gcd(&4); let _y = 10_u32.extended_gcd(&4);...
_From @L117 on June 22, 2017 9:55_ When dealing with primitive integers it's fast and easy to increment/decrement with `x += 1;`/`x -= 1;`, but with `BigInt`/`BigUint` it wastes an...
The build of the Debian package of `num-integer` 0.1.41 failed test_lcm_overflow on sparc64, it succeeded on the other Debian architectures. Test log can be found at https://buildd.debian.org/status/fetch.php?pkg=rust-num-integer&arch=sparc64&ver=0.1.41-1&stamp=1562827854&raw=0 The relevant output...