diff options
| author | Linus Färnstrand <faern@faern.net> | 2020-02-04 23:08:59 +0100 |
|---|---|---|
| committer | Linus Färnstrand <faern@faern.net> | 2020-02-12 20:20:56 +0100 |
| commit | 83191c2da6da6c13466f7f30568cdea02c761ca0 (patch) | |
| tree | d066dd07e65828fcf8c34c2c4cc062a842c2735c /src | |
| parent | 086927480be716a14f9c68954d417b544066184b (diff) | |
| download | rust-83191c2da6da6c13466f7f30568cdea02c761ca0.tar.gz rust-83191c2da6da6c13466f7f30568cdea02c761ca0.zip | |
Update float documentation to use associated consts
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/f32.rs | 15 | ||||
| -rw-r--r-- | src/libcore/num/f64.rs | 9 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index ee3e09f3577..3a2f3691d8a 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -213,8 +213,6 @@ impl f32 { /// Returns `true` if this value is `NaN`. /// /// ``` - /// use std::f32; - /// /// let nan = f32::NAN; /// let f = 7.0_f32; /// @@ -239,8 +237,6 @@ impl f32 { /// `false` otherwise. /// /// ``` - /// use std::f32; - /// /// let f = 7.0f32; /// let inf = f32::INFINITY; /// let neg_inf = f32::NEG_INFINITY; @@ -261,8 +257,6 @@ impl f32 { /// Returns `true` if this number is neither infinite nor `NaN`. /// /// ``` - /// use std::f32; - /// /// let f = 7.0f32; /// let inf = f32::INFINITY; /// let neg_inf = f32::NEG_INFINITY; @@ -286,8 +280,6 @@ impl f32 { /// [subnormal], or `NaN`. /// /// ``` - /// use std::f32; - /// /// let min = f32::MIN_POSITIVE; // 1.17549435e-38f32 /// let max = f32::MAX; /// let lower_than_min = 1.0e-40_f32; @@ -315,7 +307,6 @@ impl f32 { /// /// ``` /// use std::num::FpCategory; - /// use std::f32; /// /// let num = 12.4_f32; /// let inf = f32::INFINITY; @@ -375,8 +366,6 @@ impl f32 { /// Takes the reciprocal (inverse) of a number, `1/x`. /// /// ``` - /// use std::f32; - /// /// let x = 2.0_f32; /// let abs_difference = (x.recip() - (1.0 / x)).abs(); /// @@ -391,7 +380,7 @@ impl f32 { /// Converts radians to degrees. /// /// ``` - /// use std::f32::{self, consts}; + /// use std::f32::consts; /// /// let angle = consts::PI; /// @@ -410,7 +399,7 @@ impl f32 { /// Converts degrees to radians. /// /// ``` - /// use std::f32::{self, consts}; + /// use std::f32::consts; /// /// let angle = 180.0f32; /// diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 40c1cee1d2d..ca81f98a6b5 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -212,8 +212,6 @@ impl f64 { /// Returns `true` if this value is `NaN`. /// /// ``` - /// use std::f64; - /// /// let nan = f64::NAN; /// let f = 7.0_f64; /// @@ -238,8 +236,6 @@ impl f64 { /// `false` otherwise. /// /// ``` - /// use std::f64; - /// /// let f = 7.0f64; /// let inf = f64::INFINITY; /// let neg_inf = f64::NEG_INFINITY; @@ -260,8 +256,6 @@ impl f64 { /// Returns `true` if this number is neither infinite nor `NaN`. /// /// ``` - /// use std::f64; - /// /// let f = 7.0f64; /// let inf: f64 = f64::INFINITY; /// let neg_inf: f64 = f64::NEG_INFINITY; @@ -285,8 +279,6 @@ impl f64 { /// [subnormal], or `NaN`. /// /// ``` - /// use std::f64; - /// /// let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308f64 /// let max = f64::MAX; /// let lower_than_min = 1.0e-308_f64; @@ -314,7 +306,6 @@ impl f64 { /// /// ``` /// use std::num::FpCategory; - /// use std::f64; /// /// let num = 12.4_f64; /// let inf = f64::INFINITY; |
