@@ -16,12 +16,20 @@ use crate::sys::cmath;
1616#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1717pub use core:: f32:: consts;
1818#[ stable( feature = "rust1" , since = "1.0.0" ) ]
19+ #[ allow( deprecated_in_future) ]
20+ #[ allow( deprecated) ]
1921pub use core:: f32:: { DIGITS , EPSILON , MANTISSA_DIGITS , RADIX } ;
2022#[ stable( feature = "rust1" , since = "1.0.0" ) ]
23+ #[ allow( deprecated_in_future) ]
24+ #[ allow( deprecated) ]
2125pub use core:: f32:: { INFINITY , MAX_10_EXP , NAN , NEG_INFINITY } ;
2226#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27+ #[ allow( deprecated_in_future) ]
28+ #[ allow( deprecated) ]
2329pub use core:: f32:: { MAX , MIN , MIN_POSITIVE } ;
2430#[ stable( feature = "rust1" , since = "1.0.0" ) ]
31+ #[ allow( deprecated_in_future) ]
32+ #[ allow( deprecated) ]
2533pub use core:: f32:: { MAX_EXP , MIN_10_EXP , MIN_EXP } ;
2634
2735#[ cfg( not( test) ) ]
@@ -181,8 +189,6 @@ impl f32 {
181189 /// # Examples
182190 ///
183191 /// ```
184- /// use std::f32;
185- ///
186192 /// let f = 3.5_f32;
187193 ///
188194 /// assert_eq!(f.signum(), 1.0);
@@ -194,7 +200,7 @@ impl f32 {
194200 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
195201 #[ inline]
196202 pub fn signum ( self ) -> f32 {
197- if self . is_nan ( ) { NAN } else { 1.0_f32 . copysign ( self ) }
203+ if self . is_nan ( ) { Self :: NAN } else { 1.0_f32 . copysign ( self ) }
198204 }
199205
200206 /// Returns a number composed of the magnitude of `self` and the sign of
@@ -207,8 +213,6 @@ impl f32 {
207213 /// # Examples
208214 ///
209215 /// ```
210- /// use std::f32;
211- ///
212216 /// let f = 3.5_f32;
213217 ///
214218 /// assert_eq!(f.copysign(0.42), 3.5_f32);
@@ -234,8 +238,6 @@ impl f32 {
234238 /// # Examples
235239 ///
236240 /// ```
237- /// use std::f32;
238- ///
239241 /// let m = 10.0_f32;
240242 /// let x = 4.0_f32;
241243 /// let b = 60.0_f32;
@@ -362,8 +364,6 @@ impl f32 {
362364 /// # Examples
363365 ///
364366 /// ```
365- /// use std::f32;
366- ///
367367 /// let positive = 4.0_f32;
368368 /// let negative = -4.0_f32;
369369 ///
@@ -898,8 +898,6 @@ impl f32 {
898898 /// # Examples
899899 ///
900900 /// ```
901- /// use std::f32;
902- ///
903901 /// let e = f32::consts::E;
904902 /// let x = 1.0f32;
905903 ///
@@ -922,8 +920,6 @@ impl f32 {
922920 /// # Examples
923921 ///
924922 /// ```
925- /// use std::f32;
926- ///
927923 /// let x = 1.0f32;
928924 /// let f = x.sinh().asinh();
929925 ///
@@ -935,8 +931,8 @@ impl f32 {
935931 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
936932 #[ inline]
937933 pub fn asinh ( self ) -> f32 {
938- if self == NEG_INFINITY {
939- NEG_INFINITY
934+ if self == Self :: NEG_INFINITY {
935+ Self :: NEG_INFINITY
940936 } else {
941937 ( self + ( ( self * self ) + 1.0 ) . sqrt ( ) ) . ln ( ) . copysign ( self )
942938 }
@@ -947,8 +943,6 @@ impl f32 {
947943 /// # Examples
948944 ///
949945 /// ```
950- /// use std::f32;
951- ///
952946 /// let x = 1.0f32;
953947 /// let f = x.cosh().acosh();
954948 ///
@@ -960,16 +954,14 @@ impl f32 {
960954 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
961955 #[ inline]
962956 pub fn acosh ( self ) -> f32 {
963- if self < 1.0 { crate :: f32 :: NAN } else { ( self + ( ( self * self ) - 1.0 ) . sqrt ( ) ) . ln ( ) }
957+ if self < 1.0 { Self :: NAN } else { ( self + ( ( self * self ) - 1.0 ) . sqrt ( ) ) . ln ( ) }
964958 }
965959
966960 /// Inverse hyperbolic tangent function.
967961 ///
968962 /// # Examples
969963 ///
970964 /// ```
971- /// use std::f32;
972- ///
973965 /// let e = f32::consts::E;
974966 /// let f = e.tanh().atanh();
975967 ///
@@ -1023,8 +1015,6 @@ impl f32 {
10231015
10241016#[ cfg( test) ]
10251017mod tests {
1026- use crate :: f32;
1027- use crate :: f32:: * ;
10281018 use crate :: num:: FpCategory as Fp ;
10291019 use crate :: num:: * ;
10301020
@@ -1035,14 +1025,14 @@ mod tests {
10351025
10361026 #[ test]
10371027 fn test_min_nan ( ) {
1038- assert_eq ! ( NAN . min( 2.0 ) , 2.0 ) ;
1039- assert_eq ! ( 2.0f32 . min( NAN ) , 2.0 ) ;
1028+ assert_eq ! ( f32 :: NAN . min( 2.0 ) , 2.0 ) ;
1029+ assert_eq ! ( 2.0f32 . min( f32 :: NAN ) , 2.0 ) ;
10401030 }
10411031
10421032 #[ test]
10431033 fn test_max_nan ( ) {
1044- assert_eq ! ( NAN . max( 2.0 ) , 2.0 ) ;
1045- assert_eq ! ( 2.0f32 . max( NAN ) , 2.0 ) ;
1034+ assert_eq ! ( f32 :: NAN . max( 2.0 ) , 2.0 ) ;
1035+ assert_eq ! ( 2.0f32 . max( f32 :: NAN ) , 2.0 ) ;
10461036 }
10471037
10481038 #[ test]
0 commit comments