File tree 4 files changed +32
-12
lines changed
4 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -250,9 +250,14 @@ impl f128 {
250
250
///
251
251
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
252
252
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
253
- /// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
254
- /// is not generally guaranteed. See [specification of NaN bit
255
- /// patterns](primitive@f32#nan-bit-patterns) for more info.
253
+ /// returned.
254
+ ///
255
+ /// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
256
+ /// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
257
+ /// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
258
+ /// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
259
+ /// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
260
+ /// info.
256
261
///
257
262
/// # Examples
258
263
///
Original file line number Diff line number Diff line change @@ -249,9 +249,14 @@ impl f16 {
249
249
///
250
250
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
251
251
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
252
- /// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
253
- /// is not generally guaranteed. See [specification of NaN bit
254
- /// patterns](primitive@f32#nan-bit-patterns) for more info.
252
+ /// returned.
253
+ ///
254
+ /// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
255
+ /// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
256
+ /// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
257
+ /// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
258
+ /// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
259
+ /// info.
255
260
///
256
261
/// # Examples
257
262
///
Original file line number Diff line number Diff line change @@ -228,9 +228,14 @@ impl f32 {
228
228
///
229
229
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
230
230
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
231
- /// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
232
- /// is not generally guaranteed. See [specification of NaN bit
233
- /// patterns](primitive@f32#nan-bit-patterns) for more info.
231
+ /// returned.
232
+ ///
233
+ /// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
234
+ /// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
235
+ /// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
236
+ /// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
237
+ /// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
238
+ /// info.
234
239
///
235
240
/// # Examples
236
241
///
Original file line number Diff line number Diff line change @@ -228,9 +228,14 @@ impl f64 {
228
228
///
229
229
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
230
230
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
231
- /// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
232
- /// is not generally guaranteed. See [specification of NaN bit
233
- /// patterns](primitive@f32#nan-bit-patterns) for more info.
231
+ /// returned.
232
+ ///
233
+ /// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
234
+ /// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
235
+ /// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
236
+ /// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
237
+ /// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
238
+ /// info.
234
239
///
235
240
/// # Examples
236
241
///
You can’t perform that action at this time.
0 commit comments