67: Update README.md alternatives section for apint r=cuviper a=Robbepop
The apint crate is stable as of Rust version 1.26.
Co-authored-by: Hero Bird <robbepop@web.de>
64: Implement operators with 128bits r=cuviper a=dignifiedquire
- Depends on #63
- This is the second part to #40
Co-authored-by: dignifiedquire <dignifiedquire@gmail.com>
56: Implement Roots for BigInt and BigUint r=cuviper a=mancabizjak
Supersedes #51 .
Since there is now a `Roots` trait with `sqrt`, `cbrt` and `nth_root` methods in the `num-integer` crate, this PR implements it for `BigInt` and `BigUint` types. I also added inherent methods on both types to allow the users access to all these functions without having to import `Roots`.
PS: `nth_root` currently uses `num_traits::pow`. Should we perhaps wait for #54 to get merged, and then replace the call to use the new `pow::Pow` implementation on `BigUint`?
Co-authored-by: Manca Bizjak <manca.bizjak@xlab.si>
This commit overrides default implementations of
Roots::sqrt and Roots::cbrt for BigInt and BigUint
with optimized ones. It also improves tests and
resolves minor inconsistencies.
Signed-off-by: Manca Bizjak <manca.bizjak@xlab.si>
This commit implements num-integer::Roots trait
for BigInt and BigUint types, and also adds sqrt,
cbrt, nth_root as inherent methods to allow access
to them without importing Roots trait. For each
type tests were added as submodules in the roots
test module.
Signed-off-by: Manca Bizjak <manca.bizjak@xlab.si>
53: switch gen_biguint to fill_bytes r=cuviper a=TheIronBorn
Changes `gen_biguint` from a `push(gen::<u32>)` method to rand's [`fill_bytes`](https://docs.rs/rand/0.5.0/rand/trait.RngCore.html#tymethod.fill_bytes). This should improve performance in most cases.
- For small PRNGs which only natively generate 64 bits (like Xorshift64 or [`splitmix64.c`](http://prng.di.unimi.it/splitmix64.c)), this will no longer throw away half the bits generated.
- For block PRNGs like `StdRng`, this should reduce overhead.
- For an SIMD PRNG (https://github.com/rust-lang-nursery/rand/issues/377), this would be a significant improvement.
```diff,ignore
name no_fill ns/iter fill ns/iter diff ns/iter diff % speedup
+rand_1009 256 222 -34 -13.28% x 1.15
+rand_131072 27,366 14,715 -12,651 -46.23% x 1.86
+rand_2048 459 357 -102 -22.22% x 1.29
-rand_256 93 130 37 39.78% x 0.72
+rand_4096 842 557 -285 -33.85% x 1.51
-rand_64 69 92 23 33.33% x 0.75
+rand_65536 13,625 7,382 -6,243 -45.82% x 1.85
+rand_8192 1,836 869 -967 -52.67% x 2.11
```
(i.e. `rand_1009` does `gen_biguint(1009)`. All benches are powers of two except `rand_1009`)
(Let me know if you want the `rand_` benches added)
Co-authored-by: TheIronBorn <>
Co-authored-by: Josh Stone <cuviper@gmail.com>
52: Make sure benchmarks can be built r=cuviper a=cuviper
This fixes the rand seeds, and builds benches in nightly CI.
Co-authored-by: Josh Stone <cuviper@gmail.com>