diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-12-02 17:07:29 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-12-10 11:47:55 -0800 |
| commit | da50f7c288b8e6856b42fd923f3479af1c94b3bf (patch) | |
| tree | 8f1aa965704dc20ec8140fd7b7649e050ec9f0ee /src/libstd/num/f32.rs | |
| parent | 08a5b112ed7af90e31a355e409f637997e458fbc (diff) | |
| download | rust-da50f7c288b8e6856b42fd923f3479af1c94b3bf.tar.gz rust-da50f7c288b8e6856b42fd923f3479af1c94b3bf.zip | |
std: Remove deprecated functionality from 1.5
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
Diffstat (limited to 'src/libstd/num/f32.rs')
| -rw-r--r-- | src/libstd/num/f32.rs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index c87becd741e..30bee80fbf6 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -18,7 +18,7 @@ use core::num; use intrinsics; use libc::c_int; -use num::{FpCategory, ParseFloatError}; +use num::FpCategory; #[stable(feature = "rust1", since = "1.0.0")] pub use core::f32::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON}; @@ -126,16 +126,6 @@ mod cmath { #[cfg(not(test))] #[lang = "f32"] impl f32 { - /// Parses a float as with a given radix - #[unstable(feature = "float_from_str_radix", reason = "recently moved API", - issue = "27736")] - #[rustc_deprecated(since = "1.4.0", - reason = "unclear how useful or correct this is")] - #[allow(deprecated)] - pub fn from_str_radix(s: &str, radix: u32) -> Result<f32, ParseFloatError> { - num::Float::from_str_radix(s, radix) - } - /// Returns `true` if this value is `NaN` and false otherwise. /// /// ``` @@ -1712,11 +1702,9 @@ mod tests { #[test] fn test_ldexp() { - // We have to use from_str until base-2 exponents - // are supported in floating-point literals - let f1: f32 = f32::from_str_radix("1p-123", 16).unwrap(); - let f2: f32 = f32::from_str_radix("1p-111", 16).unwrap(); - let f3: f32 = f32::from_str_radix("1.Cp-12", 16).unwrap(); + let f1 = 2.0f32.powi(-123); + let f2 = 2.0f32.powi(-111); + let f3 = 1.75 * 2.0f32.powi(-12); assert_eq!(f32::ldexp(1f32, -123), f1); assert_eq!(f32::ldexp(1f32, -111), f2); assert_eq!(f32::ldexp(1.75f32, -12), f3); @@ -1734,11 +1722,9 @@ mod tests { #[test] fn test_frexp() { - // We have to use from_str until base-2 exponents - // are supported in floating-point literals - let f1: f32 = f32::from_str_radix("1p-123", 16).unwrap(); - let f2: f32 = f32::from_str_radix("1p-111", 16).unwrap(); - let f3: f32 = f32::from_str_radix("1.Cp-123", 16).unwrap(); + let f1 = 2.0f32.powi(-123); + let f2 = 2.0f32.powi(-111); + let f3 = 1.75 * 2.0f32.powi(-123); let (x1, exp1) = f1.frexp(); let (x2, exp2) = f2.frexp(); let (x3, exp3) = f3.frexp(); |
