diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-06-28 08:56:56 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-07-03 10:49:01 -0700 |
| commit | 3016626c3aa4bc44807e54a8ba8b9e367ff566f5 (patch) | |
| tree | 4dd6d30026ff2b9af406e1923e9f954da8e62690 /src/libcore/num/flt2dec | |
| parent | 375fa6ef371a0ae248968d363226101ef741127e (diff) | |
std: Stabilize APIs for the 1.11.0 release
Although the set of APIs being stabilized this release is relatively small, the
trains keep going! Listed below are the APIs in the standard library which have
either transitioned from unstable to stable or those from unstable to
deprecated.
Stable
* `BTreeMap::{append, split_off}`
* `BTreeSet::{append, split_off}`
* `Cell::get_mut`
* `RefCell::get_mut`
* `BinaryHeap::append`
* `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past
libstd stabilizations
* `Iterator::sum`
* `Iterator::product`
Deprecated
* `{f32, f64}::next_after`
* `{f32, f64}::integer_decode`
* `{f32, f64}::ldexp`
* `{f32, f64}::frexp`
* `num::One`
* `num::Zero`
Added APIs (all unstable)
* `iter::Sum`
* `iter::Product`
* `iter::Step` - a few methods were added to accomodate deprecation of One/Zero
Removed APIs
* `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is
unstable
Closes #27739
Closes #27752
Closes #32526
Closes #33444
Closes #34152
cc #34529 (new tracking issue)
Diffstat (limited to 'src/libcore/num/flt2dec')
| -rw-r--r-- | src/libcore/num/flt2dec/decoder.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcore/num/flt2dec/decoder.rs b/src/libcore/num/flt2dec/decoder.rs index 6265691bde9..5420e7bdd2a 100644 --- a/src/libcore/num/flt2dec/decoder.rs +++ b/src/libcore/num/flt2dec/decoder.rs @@ -13,7 +13,8 @@ use prelude::v1::*; use {f32, f64}; -use num::{Float, FpCategory}; +use num::FpCategory; +use num::dec2flt::rawfp::RawFloat; /// Decoded unsigned finite value, such that: /// @@ -52,7 +53,7 @@ pub enum FullDecoded { } /// A floating point type which can be `decode`d. -pub trait DecodableFloat: Float + Copy { +pub trait DecodableFloat: RawFloat + Copy { /// The minimum positive normalized value. fn min_pos_norm_value() -> Self; } @@ -68,7 +69,7 @@ impl DecodableFloat for f64 { /// Returns a sign (true when negative) and `FullDecoded` value /// from given floating point number. pub fn decode<T: DecodableFloat>(v: T) -> (/*negative?*/ bool, FullDecoded) { - let (mant, exp, sign) = v.integer_decode(); + let (mant, exp, sign) = v.integer_decode2(); let even = (mant & 1) == 0; let decoded = match v.classify() { FpCategory::Nan => FullDecoded::Nan, @@ -82,7 +83,7 @@ pub fn decode<T: DecodableFloat>(v: T) -> (/*negative?*/ bool, FullDecoded) { exp: exp, inclusive: even }) } FpCategory::Normal => { - let minnorm = <T as DecodableFloat>::min_pos_norm_value().integer_decode(); + let minnorm = <T as DecodableFloat>::min_pos_norm_value().integer_decode2(); if mant == minnorm.0 { // neighbors: (maxmant, exp - 1) -- (minnormmant, exp) -- (minnormmant + 1, exp) // where maxmant = minnormmant * 2 - 1 |
