Commit Graph

32 Commits

Author SHA1 Message Date
Keith Wansbrough ef83e851e7 Add keywords and categories to subcrates too. 2017-07-11 09:30:42 +01:00
Josh Stone 3f32ad48f4 rational: make sure Hash agrees with Eq
We can't use a derived `Hash` when we have a manual `Eq`, because we
need to uphold the invariant `a == b` → `h(a) == h(b)`.  Since `Eq`
doesn't require them to be in reduced form, `Hash` also needs to be
normalized.
2017-06-29 11:52:25 -07:00
Josh Stone 81e932b671 rational: bump to 0.1.38 2017-06-09 10:58:40 -07:00
Josh Stone 8b9cdaada2 Test and fix subcrates with --no-default-features
- The CI script now tests them all with --no-default-features.
- bigint: testing needs rand even when the main feature is disabled.
- rational: gate `FromPrimitive for Ratio<BigInt>` on having bigint.
2017-06-09 09:54:50 -07:00
Josh Stone 1033388e02 rational: bump to 0.1.37 2017-06-08 23:50:30 -07:00
Homu ef752e4687 Auto merge of #291 - cuviper:hasher, r=cuviper
Get the default hasher indirectly

`DefaultHasher` wasn't stable until 1.13, at which point all the other
hashers were deprecated, so it's not easy for us to name a hasher type to
use for testing.  However, `RandomState` has been stable since 1.7, and it
implements `BuildHasher` that has a `Hasher` associated type.

(extends #287)
2017-05-07 14:48:07 +09:00
Josh Stone 1b895a8632 Get the default hasher indirectly
`DefaultHasher` wasn't stable until 1.13, at which point all the other
hashers were deprecated, so it's not easy for us to name a hasher type
to use for testing.  However, `RandomState` has been stable since 1.7,
and it implements `BuildHasher` that has a `Hasher` associated type.
2017-05-06 22:23:31 -07:00
Sebastian Dröge f74753089b rational: Implement approximation from floats and FromPrimitive for various types
FromPrimitive is implemented for i8/16/32/64 and BigInt.

https://github.com/rust-num/num/issues/282
2017-05-02 02:28:27 +03:00
Patrick Jackson 71a15212a1 Replace deprecated SipHasher. 2017-04-28 18:48:50 -07:00
Josh Stone 1a66ee9e80 Add licenses to subcrates 2017-02-26 13:39:23 -08:00
Anders Kaseorg fd44a86866 rational: test_recip_fail: Correct should_panic syntax
Fixes this warning:

warning: attribute must be of the form: `#[should_panic]` or `#[should_panic(expected = "error message")]`
    --> rational/src/lib.rs:1051:7
     |
1051 |     #[should_panic = "== 0"]
     |       ^^^^^^^^^^^^^^^^^^^^^
     |
     = note: Errors in this attribute were erroneously allowed and will become a hard error in a future release.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2017-01-06 15:05:01 -05:00
dnsl48 9d7ab663b1 From<(T,T)> implementation 2016-12-10 09:19:02 +13:00
dnsl48 70da35dff5 Into<(T,T)> implementation 2016-12-10 08:39:06 +13:00
Wictor Lund 4bdad38eee Added test for trait From<T> for Ratio<T> where T: Clone + Integer. 2016-12-01 22:07:03 +02:00
Wictor Lund de91d5d9e3 Added trait From<T> for Ratio<T> where T: Clone + Integer 2016-12-01 21:38:53 +02:00
bluss ff2a350e98 Use the integer32 playground 2016-11-02 19:51:10 +01:00
bluss e4a6956e5a Add doc(html_root_url) and other doc attrs to each crate
Also update to use https instead of http. This avois mixed content
degradation on docs.rs.

The doc root URLs are correct as they are, the URL does not include the
crate name itself.
2016-11-01 02:14:23 +01:00
Josh Stone c8ed8ff87b num, bigint, complex, rational, traits: 0.1.35 2016-08-18 08:28:34 -07:00
Richard Janis Goldschmidt a4ccb797cf Allow serde version in [0.7,0.9) 2016-08-17 12:20:08 +02:00
Richard Janis Goldschmidt 20360ebccf Fix deserialization by giving type annotations. 2016-08-17 12:05:09 +02:00
Richard Janis Goldschmidt 7339d6cb9a Remove redundant `use serde`; it is an external crate. 2016-08-17 12:05:09 +02:00
Michael Lamparski 32dee9a0c8 rational: small additional tweaks
Move `new` to top to make it more visible in the docs.

Replace instances of $x == Zero::zero()$ with $x.is_zero()$,
partially addressing #11.
2016-07-24 14:58:43 -04:00
Michael Lamparski 8c75506f22 Ratio::recip now corrects sign and fails for zero 2016-07-24 14:54:06 -04:00
Michael Lamparski c84c4d15ba Improve Ratio docs
Closes #208.  Clarifies the rounding behavior of some methods and
makes formatting more uniform.
2016-07-24 14:34:55 -04:00
Josh Stone 0dd410468c rational: add path-dependency versions 2016-04-14 00:39:07 -07:00
Josh Stone 2e8ce33d84 Bump all num crates to 0.1.32 2016-04-14 00:17:42 -07: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
Łukasz Jan Niemier 58b5fe5883 Serializers dependencies 2016-04-11 20:43:07 +02:00
Łukasz Jan Niemier 3d11940538 Better descriptions for subcrates 2016-04-10 10:31:22 +02:00
Josh Stone 21a328ad6d bigint, rational: use std::hash only for testing 2016-03-25 17:50:51 -07:00
Łukasz Jan Niemier 7c0ab30bdc Fix subpackages metadata 2016-03-11 10:22:26 +01:00
Łukasz Jan Niemier 54685c46a1 Extract rational 2016-03-11 01:06:37 +01:00