Skip to content

Commit 209b0b4

Browse files
committed
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
2 parents 2982dbf + 350e492 commit 209b0b4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/libstd/f32.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ impl f32 {
193193
}
194194

195195
/// Returns a number composed of the magnitude of `self` and the sign of
196-
/// `y`.
196+
/// `sign`.
197197
///
198-
/// Equal to `self` if the sign of `self` and `y` are the same, otherwise
198+
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise
199199
/// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of
200-
/// `y` is returned.
200+
/// `sign` is returned.
201201
///
202202
/// # Examples
203203
///
@@ -216,8 +216,8 @@ impl f32 {
216216
#[inline]
217217
#[must_use]
218218
#[stable(feature = "copysign", since = "1.35.0")]
219-
pub fn copysign(self, y: f32) -> f32 {
220-
unsafe { intrinsics::copysignf32(self, y) }
219+
pub fn copysign(self, sign: f32) -> f32 {
220+
unsafe { intrinsics::copysignf32(self, sign) }
221221
}
222222

223223
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding

src/libstd/f64.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ impl f64 {
171171
}
172172

173173
/// Returns a number composed of the magnitude of `self` and the sign of
174-
/// `y`.
174+
/// `sign`.
175175
///
176-
/// Equal to `self` if the sign of `self` and `y` are the same, otherwise
176+
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise
177177
/// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of
178-
/// `y` is returned.
178+
/// `sign` is returned.
179179
///
180180
/// # Examples
181181
///
@@ -194,8 +194,8 @@ impl f64 {
194194
#[inline]
195195
#[must_use]
196196
#[stable(feature = "copysign", since = "1.35.0")]
197-
pub fn copysign(self, y: f64) -> f64 {
198-
unsafe { intrinsics::copysignf64(self, y) }
197+
pub fn copysign(self, sign: f64) -> f64 {
198+
unsafe { intrinsics::copysignf64(self, sign) }
199199
}
200200

201201
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding

0 commit comments

Comments
 (0)