Rollup merge of #129683 - RalfJung:copysign, r=thomcc · patricklam/verify-rust-std@d2a001d

4 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -250,9 +250,14 @@ impl f128 {

250250

///

251251

/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.

252252

/// 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.

256261

///

257262

/// # Examples

258263

///

Original file line numberDiff line numberDiff line change

@@ -249,9 +249,14 @@ impl f16 {

249249

///

250250

/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.

251251

/// 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.

255260

///

256261

/// # Examples

257262

///

Original file line numberDiff line numberDiff line change

@@ -228,9 +228,14 @@ impl f32 {

228228

///

229229

/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.

230230

/// 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.

234239

///

235240

/// # Examples

236241

///

Original file line numberDiff line numberDiff line change

@@ -228,9 +228,14 @@ impl f64 {

228228

///

229229

/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.

230230

/// 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.

234239

///

235240

/// # Examples

236241

///