Commit Graph

842 Commits

Author SHA1 Message Date
Josh Stone 2e8ce33d84 Bump all num crates to 0.1.32 2016-04-14 00:17:42 -07:00
Homu 774bf31ec6 Auto merge of #182 - ollie27:ratio_posneg, r=cuviper
Correct Ratio::is_negative and Ratio::is_positive

Zero is not positive or negative.

This was broken in 8be7e7bab5.
2016-04-14 07:05:42 +09:00
Oliver Middleton c22e3bf9a2 Correct Ratio::is_negative and Ratio::is_positive
Zero is not positive or negative.

This was broken in 8be7e7bab5.
2016-04-13 22:47:15 +01:00
Homu 095738e7de Auto merge of #164 - rust-num:split-into-crates, r=cuviper
Move segments of library to separate crates

Issue #102

- [x] traits
- [x] bigint
- [x] integer
- [x] complex
- [x] iter
- [x] rational
2016-04-14 05:30:34 +09:00
Łukasz Jan Niemier 58b5fe5883 Serializers dependencies 2016-04-11 20:43:07 +02:00
Łukasz Jan Niemier e59ead7b3a Add Serde crate to `num_bigint` 2016-04-11 12:32:10 +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
Josh Stone a423b39833 .multirust.sh: use the subcrated "make test" 2016-03-25 18:30:27 -07:00
Josh Stone 015cd0be43 .travis.yml: add a verbose build
I like to have a verbose build log for automation like Travis CI,
because it sometimes helps in diagnosing failures.
2016-03-25 18:30:27 -07:00
Josh Stone c9d82acf00 test_features.sh: re-enable as a simple build 2016-03-25 18:30:27 -07:00
Josh Stone 03884fdbcc bigint: reapply #176 2016-03-25 17:50:51 -07:00
Josh Stone aebbc4fd37 bigint: fix and un-ignore the first doctest 2016-03-25 17:50:51 -07:00
Josh Stone 8845ee11ed integer: reapply the rest of #167 2016-03-25 17:50:51 -07:00
Josh Stone 0114559adf Makefile: add complex and iter 2016-03-25 17:50:51 -07:00
Josh Stone 8cb026e273 complex: update testing imports and hash 2016-03-25 17:50:51 -07:00
Josh Stone e672d006a4 iter: update testing imports 2016-03-25 17:50:51 -07:00
Josh Stone dac48aa4da test_nightly.sh: update the macros path 2016-03-25 17:50:51 -07:00
Josh Stone 9d439e7860 num: don't need std::hash even for testing 2016-03-25 17:50:51 -07:00
Josh Stone 21a328ad6d bigint, rational: use std::hash only for testing 2016-03-25 17:50:51 -07:00
Josh Stone 529d7634dd num: use original num_foo crate names for imports
Rust 1.0.0 can't seem to find `foo::bar` imports from renamed crates like
`pub use num_foo as foo`.  Use `num_foo::bar` instead.
2016-03-25 17:50:38 -07:00
Josh Stone b73cfa57bb traits: use `cast` items before `int`
For some reason, rustc 1.0.0 can't find `PrimInt` if it's before `cast`,
but later versions are fine with this.  That may have been a compiler
bug that was fixed.  Switching the order seems to work everywhere.
2016-03-25 16:12:56 -07:00
Łukasz Jan Niemier 37325eec73 Remove unknown test flag 2016-03-25 12:53:34 +01:00
Łukasz Jan Niemier b962e2b708 Remove leftovers 2016-03-25 12:40:34 +01:00
Łukasz Jan Niemier 956bb0f4db Reapply ebed6756de 2016-03-25 12:34:48 +01:00
Łukasz Jan Niemier 72fa7ece48 Reapply #167 2016-03-11 10:24:10 +01: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 2a67a5b86e Extract num-rational 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 4361521f5a Move num-macros to macros to fit new naming system 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
Homu 7eb666f6b8 Auto merge of #176 - murarth:bigint-bits, r=cuviper
Expose `BigUint::bits` through `BigInt`
2016-03-06 06:00:56 +09:00
Murarth df34563eda Expose `BigUint::bits` through `BigInt` 2016-03-05 13:46:22 -07:00
Homu 9b0d4c91cb Auto merge of #171 - erickt:serde, r=hauleth
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 20:17:18 +09: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
Homu 9079b88b1c Auto merge of #169 - cuviper:rational-overflow, r=hauleth
Avoid overflows in Ratio's Ord::cmp

Fixes #7
2016-02-25 20:29:50 +09:00
Josh Stone 4e66bbe6a7 Avoid overflows in Ratio's Ord::cmp
Fixes #7
2016-02-22 18:10:29 -08:00
Josh Stone 8be7e7bab5 Simplify some Ratio methods 2016-02-22 18:09:21 -08:00
Josh Stone 5b2cb8df97 Simplify Integer dependant traits
- Integer only needs to require Ord explicitly, and then PartialOrd, Eq,
  and PartialEq come transitively.
- Generics on Integer can implicitly use all of those comparison traits.

This should not be a breaking change, as it doesn't actually change any
effective trait requirements -- only what's explicit for simplicity.
2016-02-22 15:34:10 -08:00
Homu 2f63d3bdc3 Auto merge of #168 - crazymykl:literally-positive, r=cuviper
Allow unary `+` when parsing Big{U,}Int from strings
2016-02-22 08:40:15 +09:00
Mike MacDonald (crazymykl) 9def836603 Allow unary `+` when parsing BigInt from strings 2016-02-21 18:09:56 -05:00
Homu 69f11004f6 Auto merge of #167 - pnkfelix:fix-issue-166, r=cuviper
Reorder ops in LCM to avoid overflow.

Reorder ops in LCM to avoid overflow.

Fix #166
2016-02-19 07:10:29 +09:00
Felix S. Klock II d298262573 Reorder ops in LCM to avoid overflow. Fix #166 2016-02-18 22:49:34 +01:00
Josh Stone 7a33808b07 Publish num 0.1.31 2016-02-17 00:44:20 -08:00
Josh Stone ebed6756de impl Debug for ParseFloatError
Fixes #165.
2016-02-16 15:37:06 -08:00
Homu 1a15d33560 Auto merge of #163 - gmorenz:update_nightly, r=hauleth
Update num_macros to current nightly

Fixes num_macros build for current nightly, broken by [this](https://github.com/rust-lang/rust/pull/31487/files) PR on rust.
2016-02-16 07:44:46 +09:00