]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/num/f32.rs
std: Stabilize/deprecate features for 1.4
[rust.git] / src / libstd / num / f32.rs
index 9c4320ff6334c2a1e7fd9f59c7c078b4c8f07ef2..a04dfbeebe8e6b18704e3d2b88d4057a4381ef05 100644 (file)
@@ -123,7 +123,10 @@ pub unsafe fn tanhf(n: c_float) -> c_float {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl f32 {
     /// Parses a float as with a given radix
-    #[unstable(feature = "float_from_str_radix", reason = "recently moved API")]
+    #[unstable(feature = "float_from_str_radix", reason = "recently moved API",
+               issue = "27736")]
+    #[deprecated(since = "1.4.0",
+                 reason = "unclear how useful or correct this is")]
     pub fn from_str_radix(s: &str, radix: u32) -> Result<f32, ParseFloatError> {
         num::Float::from_str_radix(s, radix)
     }
@@ -250,7 +253,8 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) }
     /// assert!(abs_difference <= f32::EPSILON);
     /// ```
     /// [floating-point]: ../../../../../reference.html#machine-types
-    #[unstable(feature = "float_extras", reason = "signature is undecided")]
+    #[unstable(feature = "float_extras", reason = "signature is undecided",
+               issue = "27752")]
     #[inline]
     pub fn integer_decode(self) -> (u64, i16, i8) {
         num::Float::integer_decode(self)
@@ -682,7 +686,8 @@ fn log10f(f: f32) -> f32 { unsafe { intrinsics::log10f32(f) } }
     ///
     /// assert!(abs_difference <= f32::EPSILON);
     /// ```
-    #[unstable(feature = "float_extras", reason = "desirability is unclear")]
+    #[unstable(feature = "float_extras", reason = "desirability is unclear",
+               issue = "27752")]
     #[inline]
     pub fn to_degrees(self) -> f32 { num::Float::to_degrees(self) }
 
@@ -699,7 +704,8 @@ pub fn to_degrees(self) -> f32 { num::Float::to_degrees(self) }
     ///
     /// assert!(abs_difference <= f32::EPSILON);
     /// ```
-    #[unstable(feature = "float_extras", reason = "desirability is unclear")]
+    #[unstable(feature = "float_extras", reason = "desirability is unclear",
+               issue = "27752")]
     #[inline]
     pub fn to_radians(self) -> f32 { num::Float::to_radians(self) }
 
@@ -715,7 +721,8 @@ pub fn to_radians(self) -> f32 { num::Float::to_radians(self) }
     /// assert!(abs_difference <= f32::EPSILON);
     /// ```
     #[unstable(feature = "float_extras",
-               reason = "pending integer conventions")]
+               reason = "pending integer conventions",
+               issue = "27752")]
     #[inline]
     pub fn ldexp(x: f32, exp: isize) -> f32 {
         unsafe { cmath::ldexpf(x, exp as c_int) }
@@ -743,7 +750,8 @@ pub fn ldexp(x: f32, exp: isize) -> f32 {
     /// assert!(abs_difference_1 <= f32::EPSILON);
     /// ```
     #[unstable(feature = "float_extras",
-               reason = "pending integer conventions")]
+               reason = "pending integer conventions",
+               issue = "27752")]
     #[inline]
     pub fn frexp(self) -> (f32, isize) {
         unsafe {
@@ -768,7 +776,8 @@ pub fn frexp(self) -> (f32, isize) {
     /// assert!(abs_diff <= f32::EPSILON);
     /// ```
     #[unstable(feature = "float_extras",
-               reason = "unsure about its place in the world")]
+               reason = "unsure about its place in the world",
+               issue = "27752")]
     #[inline]
     pub fn next_after(self, other: f32) -> f32 {
         unsafe { cmath::nextafterf(self, other) }
@@ -1826,7 +1835,6 @@ fn test_real_consts() {
         use super::consts;
 
         let pi: f32 = consts::PI;
-        let two_pi: f32 = consts::PI_2;
         let frac_pi_2: f32 = consts::FRAC_PI_2;
         let frac_pi_3: f32 = consts::FRAC_PI_3;
         let frac_pi_4: f32 = consts::FRAC_PI_4;
@@ -1843,7 +1851,6 @@ fn test_real_consts() {
         let ln_2: f32 = consts::LN_2;
         let ln_10: f32 = consts::LN_10;
 
-        assert_approx_eq!(two_pi, 2f32 * pi);
         assert_approx_eq!(frac_pi_2, pi / 2f32);
         assert_approx_eq!(frac_pi_3, pi / 3f32);
         assert_approx_eq!(frac_pi_4, pi / 4f32);