num-traits/traits/src
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
..
ops Move traits to separate crate 2016-03-11 01:06:05 +01:00
bounds.rs Move traits to separate crate 2016-03-11 01:06:05 +01:00
cast.rs traits: Fix ToPrimitive for f64 -> f32 conversion. 2016-04-15 13:36:29 +02:00
float.rs Extract rational 2016-03-11 01:06:37 +01:00
identities.rs Move traits to separate crate 2016-03-11 01:06:05 +01:00
int.rs Extract rational 2016-03-11 01:06:37 +01:00
lib.rs traits: use `cast` items before `int` 2016-03-25 16:12:56 -07:00
sign.rs Move traits to separate crate 2016-03-11 01:06:05 +01:00