about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-04-06 10:03:38 +0000
committerbors <bors@rust-lang.org>2019-04-06 10:03:38 +0000
commit209b0b41ac39bdeaaa0dd5d52efec4b1f8d0011f (patch)
tree2cb47cdd4e8cbec7df17d15d995707e7e35df9d5 /src/libstd
parent2982dbf855fe12e30e75175d6b0fa74e7110e1cd (diff)
parent350e492bc0d3af16d2156ed52c6c575c03db7001 (diff)
downloadrust-209b0b41ac39bdeaaa0dd5d52efec4b1f8d0011f.tar.gz
rust-209b0b41ac39bdeaaa0dd5d52efec4b1f8d0011f.zip
Auto merge of #59745 - cwhakes:master, r=sanxiyn
Change `copytest` parameter name from `y` to `sign`

This should help clarify ambiguity with whether `a.copysign(b)` applies the sign of `a` to `b` or `b` to `a`.

r? @Centril
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/f32.rs10
-rw-r--r--src/libstd/f64.rs10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs
index 2952c6aea00..133540ed6b9 100644
--- a/src/libstd/f32.rs
+++ b/src/libstd/f32.rs
@@ -193,11 +193,11 @@ impl f32 {
     }
 
     /// Returns a number composed of the magnitude of `self` and the sign of
-    /// `y`.
+    /// `sign`.
     ///
-    /// Equal to `self` if the sign of `self` and `y` are the same, otherwise
+    /// Equal to `self` if the sign of `self` and `sign` are the same, otherwise
     /// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of
-    /// `y` is returned.
+    /// `sign` is returned.
     ///
     /// # Examples
     ///
@@ -216,8 +216,8 @@ impl f32 {
     #[inline]
     #[must_use]
     #[stable(feature = "copysign", since = "1.35.0")]
-    pub fn copysign(self, y: f32) -> f32 {
-        unsafe { intrinsics::copysignf32(self, y) }
+    pub fn copysign(self, sign: f32) -> f32 {
+        unsafe { intrinsics::copysignf32(self, sign) }
     }
 
     /// Fused multiply-add. Computes `(self * a) + b` with only one rounding
diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs
index 3c3a35573ad..87467aeed8b 100644
--- a/src/libstd/f64.rs
+++ b/src/libstd/f64.rs
@@ -171,11 +171,11 @@ impl f64 {
     }
 
     /// Returns a number composed of the magnitude of `self` and the sign of
-    /// `y`.
+    /// `sign`.
     ///
-    /// Equal to `self` if the sign of `self` and `y` are the same, otherwise
+    /// Equal to `self` if the sign of `self` and `sign` are the same, otherwise
     /// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of
-    /// `y` is returned.
+    /// `sign` is returned.
     ///
     /// # Examples
     ///
@@ -194,8 +194,8 @@ impl f64 {
     #[inline]
     #[must_use]
     #[stable(feature = "copysign", since = "1.35.0")]
-    pub fn copysign(self, y: f64) -> f64 {
-        unsafe { intrinsics::copysignf64(self, y) }
+    pub fn copysign(self, sign: f64) -> f64 {
+        unsafe { intrinsics::copysignf64(self, sign) }
     }
 
     /// Fused multiply-add. Computes `(self * a) + b` with only one rounding