Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float::min/max: mention the non-determinism around signed 0 #136296

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions library/core/src/num/f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ impl f128 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
/// This also matches the behavior of libm’s fmax.
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// #![feature(f128)]
Expand All @@ -696,7 +697,8 @@ impl f128 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
/// This also matches the behavior of libm’s fmin.
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// #![feature(f128)]
Expand Down
6 changes: 4 additions & 2 deletions library/core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,8 @@ impl f16 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
/// This also matches the behavior of libm’s fmax.
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// #![feature(f16)]
Expand All @@ -687,7 +688,8 @@ impl f16 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
/// This also matches the behavior of libm’s fmin.
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// #![feature(f16)]
Expand Down
6 changes: 4 additions & 2 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,8 @@ impl f32 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
/// This also matches the behavior of libm’s fmax.
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// let x = 1.0f32;
Expand All @@ -895,7 +896,8 @@ impl f32 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
/// This also matches the behavior of libm’s fmin.
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// let x = 1.0f32;
Expand Down
6 changes: 4 additions & 2 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ impl f64 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
/// This also matches the behavior of libm’s fmax.
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// let x = 1.0_f64;
Expand All @@ -913,7 +914,8 @@ impl f64 {
/// If one of the arguments is NaN, then the other argument is returned.
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
/// This also matches the behavior of libm’s fmin.
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
///
/// ```
/// let x = 1.0_f64;
Expand Down
Loading