diff options
| author | CrLF0710 <crlf0710@gmail.com> | 2019-07-07 12:16:13 +0800 |
|---|---|---|
| committer | CrLF0710 <crlf0710@gmail.com> | 2019-07-07 12:16:13 +0800 |
| commit | 72ac8ce9aa50d4456239755076a5dd869232006e (patch) | |
| tree | 135a6a05bec166ac3d2b588e4a9a5c55f13049fd /src/libstd | |
| parent | b0bd5f236d9bea38b8c9048f379fec179b09984c (diff) | |
| download | rust-72ac8ce9aa50d4456239755076a5dd869232006e.tar.gz rust-72ac8ce9aa50d4456239755076a5dd869232006e.zip | |
Stablize Euclidean Modulo (feature euclidean_division)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/f32.rs | 6 | ||||
| -rw-r--r-- | src/libstd/f64.rs | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs index 7254c621611..f649170c403 100644 --- a/src/libstd/f32.rs +++ b/src/libstd/f32.rs @@ -256,7 +256,6 @@ impl f32 { /// # Examples /// /// ``` - /// #![feature(euclidean_division)] /// let a: f32 = 7.0; /// let b = 4.0; /// assert_eq!(a.div_euclid(b), 1.0); // 7.0 > 4.0 * 1.0 @@ -265,7 +264,7 @@ impl f32 { /// assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0 /// ``` #[inline] - #[unstable(feature = "euclidean_division", issue = "49048")] + #[stable(feature = "euclidean_division", since = "1.38.0")] pub fn div_euclid(self, rhs: f32) -> f32 { let q = (self / rhs).trunc(); if self % rhs < 0.0 { @@ -288,7 +287,6 @@ impl f32 { /// # Examples /// /// ``` - /// #![feature(euclidean_division)] /// let a: f32 = 7.0; /// let b = 4.0; /// assert_eq!(a.rem_euclid(b), 3.0); @@ -299,7 +297,7 @@ impl f32 { /// assert!((-std::f32::EPSILON).rem_euclid(3.0) != 0.0); /// ``` #[inline] - #[unstable(feature = "euclidean_division", issue = "49048")] + #[stable(feature = "euclidean_division", since = "1.38.0")] pub fn rem_euclid(self, rhs: f32) -> f32 { let r = self % rhs; if r < 0.0 { diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs index f8bb36ad0a8..f61630997dc 100644 --- a/src/libstd/f64.rs +++ b/src/libstd/f64.rs @@ -232,7 +232,6 @@ impl f64 { /// # Examples /// /// ``` - /// #![feature(euclidean_division)] /// let a: f64 = 7.0; /// let b = 4.0; /// assert_eq!(a.div_euclid(b), 1.0); // 7.0 > 4.0 * 1.0 @@ -241,7 +240,7 @@ impl f64 { /// assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0 /// ``` #[inline] - #[unstable(feature = "euclidean_division", issue = "49048")] + #[stable(feature = "euclidean_division", since = "1.38.0")] pub fn div_euclid(self, rhs: f64) -> f64 { let q = (self / rhs).trunc(); if self % rhs < 0.0 { @@ -264,7 +263,6 @@ impl f64 { /// # Examples /// /// ``` - /// #![feature(euclidean_division)] /// let a: f64 = 7.0; /// let b = 4.0; /// assert_eq!(a.rem_euclid(b), 3.0); @@ -275,7 +273,7 @@ impl f64 { /// assert!((-std::f64::EPSILON).rem_euclid(3.0) != 0.0); /// ``` #[inline] - #[unstable(feature = "euclidean_division", issue = "49048")] + #[stable(feature = "euclidean_division", since = "1.38.0")] pub fn rem_euclid(self, rhs: f64) -> f64 { let r = self % rhs; if r < 0.0 { |
