Commit Graph

12 Commits

Author SHA1 Message Date
Josh Stone fe34d17aaf Revert "Auto merge of #296 - vks:no_std, r=cuviper"
This reverts commit 8b5d4ac24e, reversing
changes made to ef752e4687.
2017-06-09 10:12:50 -07:00
Vinzent Steinberg 6253669ef4 Mark methods in `Float` whether they require `std`
This removes the `BasicFloat` trait.
2017-06-02 11:47:45 +02:00
Vinzent Steinberg 351dfc6383 traits: Introduce std feature
This makes it possible to build `traits` without `std`. For this a new
trait `BasicFloat` was introduced, implementing some basic functionality
that works with `core`. Most notably this is lacking functions like
`cos`, `sin`, etc.

`Float` is not available without `std`.

Refs #216.
2017-05-31 13:44:39 +02:00
Yoan Lecoq fd50c9196b Added trait bounds tests for Wrapping 2017-05-01 13:42:30 +02:00
Yoan Lecoq 3896c64dc7 Attempt to work around E0425 in test macros on Rust 1.8 2017-04-30 10:33:35 +02:00
Yoan Lecoq 807584688c Added some tests for Wrapping<T>'s impls 2017-04-30 10:17:06 +02:00
Yoan Lecoq f4e0b47ceb Revert #[inline] hints 2017-04-30 08:32:25 +02:00
Yoan Lecoq 760604361d Add missing #[inline] hints 2017-04-29 08:35:37 +02:00
Yoan Lecoq f249edf546 impl ToPrimitive, FromPrimitive and NumCast for Wrapping<T> 2017-04-29 08:04:59 +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
Łukasz Jan Niemier 54685c46a1 Extract rational 2016-03-11 01:06:37 +01:00
Łukasz Jan Niemier c124be549f Move traits to separate crate 2016-03-11 01:06:05 +01:00