Commit Graph

47 Commits

Author SHA1 Message Date
Yoan Lecoq 35a9bcba19 impl Bounded for Wrapping<T> 2017-04-29 07:51:04 +02:00
Yoan Lecoq b2d957fe4b Small fix for older Rust versions 2017-04-29 07:47:39 +02:00
Yoan Lecoq 579466d95c impl PrimInt for Wrapping<T> 2017-04-29 07:46:51 +02:00
Yoan Lecoq 5b126673aa impl Signed and Unsigned for Wrapping<T> 2017-04-29 07:21:14 +02:00
Yoan Lecoq 2172a9368b impl One for Wrapping doesn't require Add 2017-04-21 19:10:42 +02:00
Yoan Lecoq 356a4ba5b5 Removed useless trait bounds 2017-04-21 18:56:23 +02:00
Yoan Lecoq b562c1ec39 Minor changes for correctness 2017-04-21 18:47:42 +02:00
Yoan Lecoq 9b06d4a0bb Attempt at fixing E0411 on older rust versions 2017-04-21 10:31:29 +02:00
Yoan Lecoq b024e1c326 Implemented Zero, One and Num for Wrapping<T> 2017-04-21 09:26:53 +02:00
Josh Stone 1a66ee9e80 Add licenses to subcrates 2017-02-26 13:39:23 -08:00
Jacob Kiesel c78a48fd35 Improve documentation comments
Remove passive voice from documentation comments.
2017-02-08 15:10:01 -07:00
Jacob Kiesel 17665ec50d Update lib.rs
Make assert debug error more accurate.
2017-02-07 15:03:00 -07:00
Jacob Kiesel f8dcec366b Made requested changes. 2017-02-07 13:02:32 -07:00
Josh Stone 817ab00f64 Merge pull request #256 from nwin/add-wrapping-traits
Added traits for wrapping arithmetics.
2017-02-04 21:47:53 -08:00
nwin 58b7da46d2 Added tests. 2017-02-04 10:42:12 +01:00
Corey Farwell 19109883de Add doc example for `num_traits::Num::from_str_radix`. 2017-01-30 23:42:27 -05:00
nwin 450c0e2760 Correct typos. 2017-01-26 21:12:27 +01:00
nwin ee9d474243 Ensure compatibility with Rust 1.0.0. 2017-01-22 10:13:50 +01:00
nwin d25f53056d Added traits for wrapping arithmetics.
Added `Wrapping` traits for the most common operations. Similar to the already present `Checked` traits.
2017-01-22 09:45:35 +01: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
bluss 96e96ef762 Remove pattern in trait's method signature
This use of `mut` was nonsensical for now, but is proposed to be
disallowed by rustc in the future (as a bugfix in Rust).
2016-10-25 00:42:44 +02:00
Josh Stone f25a3bd51d 0.1.36 bump for num, traits, macros, and the new derive 2016-09-29 23:31:23 -07:00
James Lucas 381942eb4f Adding default implementation 2016-09-22 19:56:44 +01:00
James Lucas a64cf66f4c Implementing epsilon function to retrieve EPSILON constant 2016-09-18 14:36:44 -07:00
Josh Stone c8ed8ff87b num, bigint, complex, rational, traits: 0.1.35 2016-08-18 08:28:34 -07:00
Ivan Ukhov 01aad702af Add a trait for floating-point constants 2016-08-15 06:38:08 +02:00
Josh Stone 932e45c207 traits: inline integer from_str_radix 2016-08-10 22:22:53 -07:00
Josh Stone 7a9c39fa87 traits: inline Bounded tuple methods 2016-08-10 22:22:15 -07:00
Josh Stone fa451ac00c traits: inline Saturating methods 2016-08-10 22:21:53 -07:00
Josh Stone eefa2a85d0 traits: inline Float methods 2016-08-10 22:21:33 -07:00
Josh Stone 7bc7ddfc87 traits: inline PrimInt methods 2016-08-10 22:21:00 -07:00
Josh Stone 29c5ab362d traits: bump to 0.1.34 2016-07-24 11:16:11 -07:00
Josh Stone 0faeb31b09 traits: add `to_degrees` and `to_radians` on `Float`
To avoid a breaking change, these have crude default implementations as
well as better implementations for `f32` and `f64` in particular.  They
don't use the inherent methods though, because `f32` didn't stabilize
those until Rust 1.7.

Fixes #211
2016-07-23 00:34:14 -07:00
Josh Stone f056603bc0 traits: bump to 0.1.33 2016-07-12 01:10:37 -07:00
Josh Stone b21c89de36 Mask deprecation warnings on abs_sub 2016-07-12 00:34:55 -07:00
Vinzent Steinberg 3e4595eac6 Move functions remaining in num to num-traits
Fixes #102.
2016-05-13 10:38:14 +02:00
bluss acde249bf7 traits: Fix ToPrimitive for f64 -> f32 conversion.
It should use the destination type and not the source type to check if
the conversion would be to a value that's in range.

NOTE: A finite f64 value that is larger than the f32 value range now produces
None when converted to f32 with ToPrimitive.

Previously, too large f64 values would produce inf f32 values. This `as`
cast has an undefined result and was not specified to always produce for
example `inf`.

The conversion preserves nan/+-inf specifically.
2016-04-15 13:36:29 +02:00
Josh Stone 2e8ce33d84 Bump all num crates to 0.1.32 2016-04-14 00:17:42 -07:00
Łukasz Jan Niemier 3d11940538 Better descriptions for subcrates 2016-04-10 10:31:22 +02: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 956bb0f4db Reapply ebed6756de 2016-03-25 12:34:48 +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 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 c124be549f Move traits to separate crate 2016-03-11 01:06:05 +01:00