@@ -961,8 +961,16 @@ impl f64 {
961961
962962 /// Returns the maximum of the two numbers, propagating NaN.
963963 ///
964- /// This returns NaN when *either* argument is NaN, as opposed to
965- /// [`f64::max`] which only returns NaN when *both* arguments are NaN.
964+ /// If at least one of the arguments is NaN, the return value is NaN, with the bit pattern
965+ /// picked using the usual [rules for arithmetic operations](f32#nan-bit-patterns). Furthermore,
966+ /// `-0.0` is considered to be less than `+0.0`, making this function fully deterministic for
967+ /// non-NaN inputs.
968+ ///
969+ /// This is in contrast to [`f64::max`] which only returns NaN when *both* arguments are NaN,
970+ /// and which does not reliably order `-0.0` and `0.0`.
971+ ///
972+ /// This follows the IEEE 754-2019 semantics for `maximum`, and also matches the behavior
973+ /// of libm’s `fmaximum`.
966974 ///
967975 /// ```
968976 /// #![feature(float_minimum_maximum)]
@@ -972,13 +980,6 @@ impl f64 {
972980 /// assert_eq!(x.maximum(y), y);
973981 /// assert!(x.maximum(f64::NAN).is_nan());
974982 /// ```
975- ///
976- /// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
977- /// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
978- /// Note that this follows the IEEE 754-2019 semantics for `maximum`.
979- ///
980- /// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
981- /// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
982983 #[ must_use = "this returns the result of the comparison, without modifying either input" ]
983984 #[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
984985 #[ inline]
@@ -988,8 +989,16 @@ impl f64 {
988989
989990 /// Returns the minimum of the two numbers, propagating NaN.
990991 ///
991- /// This returns NaN when *either* argument is NaN, as opposed to
992- /// [`f64::min`] which only returns NaN when *both* arguments are NaN.
992+ /// If at least one of the arguments is NaN, the return value is NaN, with the bit pattern
993+ /// picked using the usual [rules for arithmetic operations](f32#nan-bit-patterns). Furthermore,
994+ /// `-0.0` is considered to be less than `+0.0`, making this function fully deterministic for
995+ /// non-NaN inputs.
996+ ///
997+ /// This is in contrast to [`f64::min`] which only returns NaN when *both* arguments are NaN,
998+ /// and which does not reliably order `-0.0` and `0.0`.
999+ ///
1000+ /// This follows the IEEE 754-2019 semantics for `minimum`, and also matches the behavior
1001+ /// of libm’s `fminimum`.
9931002 ///
9941003 /// ```
9951004 /// #![feature(float_minimum_maximum)]
@@ -999,13 +1008,6 @@ impl f64 {
9991008 /// assert_eq!(x.minimum(y), x);
10001009 /// assert!(x.minimum(f64::NAN).is_nan());
10011010 /// ```
1002- ///
1003- /// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
1004- /// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
1005- /// Note that this follows the IEEE 754-2019 semantics for `minimum`.
1006- ///
1007- /// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
1008- /// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
10091011 #[ must_use = "this returns the result of the comparison, without modifying either input" ]
10101012 #[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
10111013 #[ inline]
0 commit comments