103 Commits

Author SHA1 Message Date
dignifiedquire
2656a03c5a feat: use SmallVec as backing store 2018-12-19 19:46:26 +01:00
dignifiedquire
73a3f1eacb improve modpow perf and fix test 2018-12-19 19:10:19 +01:00
dignifiedquire
ca79006169 prepare for publishing 2018-11-24 12:04:44 +01:00
dignifiedquire
0c148e7207 start fixing after rebase 2018-11-07 13:41:59 +01:00
Josh Stone
02e2e4e7e9 Release 0.2.1 2018-11-02 17:08:29 -07:00
Manca Bizjak
1f2590656b Implement Roots for BigInt and BigUint
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>
2018-07-11 12:14:46 +02:00
Josh Stone
de836f6fdc Release 0.2.0 2018-05-25 13:45:38 -07:00
Josh Stone
ec181ea593 Update rand CI 2018-05-22 16:56:54 -07:00
Josh Stone
9fdec42818 bump to rand 0.5 2018-05-22 14:16:20 -07:00
Josh Stone
23743e05db Add a mandatory "std" feature
We don't actually support `no_std` yet, and probably won't until `alloc`
is stable.  We're just reserving this ability with the "std" feature
now, and compilation will fail without.
2018-05-16 13:59:29 -07:00
Josh Stone
04252b7716 Add basic conversions for i128 and u128 2018-05-15 18:01:14 -07:00
Josh Stone
b374f9ac92 Merge branch 'num-bigint-0.1.x' into master 2018-05-14 13:01:51 -07:00
Josh Stone
10e00ff66a Release 0.1.44 2018-05-14 11:24:39 -07:00
Josh Stone
f44bd0aee2 Add a special case for single-digit divisors
It was pointed out in the blog post [Big Integers in Zig] that we don't
have a special case in `num-bigint` for single-digit divisors.  While
you can already get this optimization by dividing directly by `u32`,
it's easy to make small `BigUint` divisors work like this too.

    $ cargo benchcmp baseline single-div
     name                   baseline ns/iter  single-div ns/iter  diff ns/iter   diff %  speedup
     factorial_div_biguint  5,638,353         1,005,488             -4,632,865  -82.17%   x 5.61

`BigInt` will also gain from this, since it uses `BigUint` division
internally.

Running [zig-bn's facdiv-rs] shows a nice improvement too.  My i7-7700K
with Rust 1.26 goes from 4.15 seconds to just 0.65 -- a 6.38x speedup!

[Big Integers in Zig]: https://tiehuis.github.io/big-integers-in-zig#division-test-single-limb
[zig-bn's facdiv-rs]: https://github.com/tiehuis/zig-bn/tree/master/bench/facdiv/crate-facdiv-rs
2018-05-14 11:24:32 -07:00
Josh Stone
087c4ecfd6 Add serde tests 2018-05-03 12:39:15 -07:00
Josh Stone
12498b20fa bump to num-traits 0.2.1 2018-03-02 21:07:22 -08:00
Josh Stone
e89c48081f Update rand and serde; drop rustc-serialize 2018-02-24 01:28:57 -08:00
Josh Stone
089b86a513 Start the bump to 0.2 2018-02-23 17:22:12 -08:00
Josh Stone
ef0b1041df Release 0.1.43 2018-02-08 17:32:57 -08:00
Josh Stone
a7bd6a0f4b Release 0.1.42 2018-02-07 22:42:51 -08:00
Josh Stone
8893408c30 add a gcd benchmark 2018-02-07 21:56:28 -08:00
Igor Gnatenko
39b88b41d2 Relax rand version
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2018-01-01 12:13:37 +01:00
Josh Stone
5918a72299 Add [[bench]] details 2017-12-18 17:29:34 -08:00
Josh Stone
6a41eaa46f Move num-bigint to its own repo
All the prior `num` history is kept, so old `num-bigint` tags are still
valid, but future development here will be just for `num-bigint`.
2017-12-17 15:44:53 -08:00
Josh Stone
c24f76781b num: bump to 0.1.41
Syncing the metacrate to the latest of all subcrates.
2017-12-01 13:31:33 -08:00
Martin Geisler
97bc42854a Add CI badge 2017-07-25 00:17:17 +02:00
Josh Stone
23d1ab689d num: bump to 0.1.40 2017-07-14 17:42:00 -07:00
Keith Wansbrough
c87faf46a6 Tweak categories based on review. 2017-07-11 09:47:15 +01:00
Keith Wansbrough
eddcb54d6b Add cargo keywords and categories.
Resolves #306. Suggestions welcome for better keywords/categories, though there is a limit of 5 of each.
2017-07-11 09:47:15 +01:00
Josh Stone
b1b034f438 num: bump to 0.1.39 2017-06-09 11:03:50 -07:00
Josh Stone
7bf9a6ccf2 num: bump to 0.1.38 2017-06-08 23:53:47 -07:00
Josh Stone
66ce252494 Bump versions in the num collection 2017-02-26 14:18:33 -08:00
Josh Stone
f25a3bd51d 0.1.36 bump for num, traits, macros, and the new derive 2016-09-29 23:31:23 -07:00
Josh Stone
c8ed8ff87b num, bigint, complex, rational, traits: 0.1.35 2016-08-18 08:28:34 -07:00
Josh Stone
e67d4630a2 num: require newer traits for moved functions, fixes #206 2016-07-12 23:24:45 -07:00
Josh Stone
29b63410ac num: bump to 0.1.33 2016-07-12 01:12:41 -07:00
Josh Stone
1e192c31ae num: add path-dependency versions 2016-04-14 00:45:03 -07:00
Josh Stone
2e8ce33d84 Bump all num crates to 0.1.32 2016-04-14 00:17:42 -07:00
Łukasz Jan Niemier
58b5fe5883 Serializers dependencies 2016-04-11 20:43:07 +02:00
Łukasz Jan Niemier
8450782413 Revert old num crate description 2016-04-11 12:30:16 +02:00
Łukasz Jan Niemier
3d11940538 Better descriptions for subcrates 2016-04-10 10:31:22 +02:00
Łukasz Jan Niemier
7c0ab30bdc Fix subpackages metadata 2016-03-11 10:22:26 +01:00
Łukasz Jan Niemier
96e9166b0a Extract iter 2016-03-11 01:06:37 +01:00
Łukasz Jan Niemier
ed076070e6 Extract complex 2016-03-11 01:06:37 +01:00
Łukasz Jan Niemier
54685c46a1 Extract rational 2016-03-11 01:06:37 +01:00
Łukasz Jan Niemier
2176b7048c Extract bigint 2016-03-11 01:06:05 +01:00
Łukasz Jan Niemier
f1a80857ee Extract integer module 2016-03-11 01:06:05 +01:00
Łukasz Jan Niemier
c124be549f Move traits to separate crate 2016-03-11 01:06:05 +01:00
Erick Tryzelaar
112923eec5 Add support for Serde 0.7.
Serde 0.7 dropped it's dependency on num, so this patch moves
the implementations here. For the sake of a better implementation,
this just serializes BigUint as a `Vec<u32>`, `BigInt` as a
`(u8, Vec<u32>)`, `Complex<T>` as a `(T, T)`, and `Ratio<T>`
as a `(T, T)`.
2016-02-27 00:07:32 -08:00
Josh Stone
7a33808b07 Publish num 0.1.31 2016-02-17 00:44:20 -08:00