copysign with sign being a NaN is non-portable
This commit is contained in:
parent
d9a2cc4dae
commit
0589dc75d3
4 changed files with 32 additions and 12 deletions
|
@ -250,9 +250,14 @@ impl f128 {
|
||||||
///
|
///
|
||||||
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
|
/// 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 same payload as `self` and the sign bit of `sign` is
|
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
|
||||||
/// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
|
/// returned.
|
||||||
/// is not generally guaranteed. See [specification of NaN bit
|
///
|
||||||
/// patterns](primitive@f32#nan-bit-patterns) for more info.
|
/// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
|
||||||
|
/// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
|
||||||
|
/// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
|
||||||
|
/// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
|
||||||
|
/// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
|
||||||
|
/// info.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|
|
@ -249,9 +249,14 @@ impl f16 {
|
||||||
///
|
///
|
||||||
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
|
/// 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 same payload as `self` and the sign bit of `sign` is
|
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
|
||||||
/// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
|
/// returned.
|
||||||
/// is not generally guaranteed. See [specification of NaN bit
|
///
|
||||||
/// patterns](primitive@f32#nan-bit-patterns) for more info.
|
/// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
|
||||||
|
/// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
|
||||||
|
/// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
|
||||||
|
/// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
|
||||||
|
/// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
|
||||||
|
/// info.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|
|
@ -228,9 +228,14 @@ impl f32 {
|
||||||
///
|
///
|
||||||
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
|
/// 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 same payload as `self` and the sign bit of `sign` is
|
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
|
||||||
/// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
|
/// returned.
|
||||||
/// is not generally guaranteed. See [specification of NaN bit
|
///
|
||||||
/// patterns](primitive@f32#nan-bit-patterns) for more info.
|
/// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
|
||||||
|
/// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
|
||||||
|
/// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
|
||||||
|
/// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
|
||||||
|
/// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
|
||||||
|
/// info.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|
|
@ -228,9 +228,14 @@ impl f64 {
|
||||||
///
|
///
|
||||||
/// Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`.
|
/// 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 same payload as `self` and the sign bit of `sign` is
|
/// If `self` is a NaN, then a NaN with the same payload as `self` and the sign bit of `sign` is
|
||||||
/// returned. Note, however, that conserving the sign bit on NaN across arithmetical operations
|
/// returned.
|
||||||
/// is not generally guaranteed. See [specification of NaN bit
|
///
|
||||||
/// patterns](primitive@f32#nan-bit-patterns) for more info.
|
/// If `sign` is a NaN, then this operation will still carry over its sign into the result. Note
|
||||||
|
/// that IEEE 754 doesn't assign any meaning to the sign bit in case of a NaN, and as Rust
|
||||||
|
/// doesn't guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the
|
||||||
|
/// result of `copysign` with `sign` being a NaN might produce an unexpected or non-portable
|
||||||
|
/// result. See the [specification of NaN bit patterns](primitive@f32#nan-bit-patterns) for more
|
||||||
|
/// info.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue