@@ -961,8 +961,15 @@ 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`.
966973 ///
967974 /// ```
968975 /// #![feature(float_minimum_maximum)]
@@ -972,13 +979,6 @@ impl f64 {
972979 /// assert_eq!(x.maximum(y), y);
973980 /// assert!(x.maximum(f64::NAN).is_nan());
974981 /// ```
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.
982982 #[ must_use = "this returns the result of the comparison, without modifying either input" ]
983983 #[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
984984 #[ inline]
@@ -988,8 +988,15 @@ impl f64 {
988988
989989 /// Returns the minimum of the two numbers, propagating NaN.
990990 ///
991- /// This returns NaN when *either* argument is NaN, as opposed to
992- /// [`f64::min`] which only returns NaN when *both* arguments are NaN.
991+ /// If at least one of the arguments is NaN, the return value is NaN, with the bit pattern
992+ /// picked using the usual [rules for arithmetic operations](f32#nan-bit-patterns). Furthermore,
993+ /// `-0.0` is considered to be less than `+0.0`, making this function fully deterministic for
994+ /// non-NaN inputs.
995+ ///
996+ /// This is in contrast to [`f64::min`] which only returns NaN when *both* arguments are NaN,
997+ /// and which does not reliably order `-0.0` and `+0.0`.
998+ ///
999+ /// This follows the IEEE 754-2019 semantics for `minimum`.
9931000 ///
9941001 /// ```
9951002 /// #![feature(float_minimum_maximum)]
@@ -999,13 +1006,6 @@ impl f64 {
9991006 /// assert_eq!(x.minimum(y), x);
10001007 /// assert!(x.minimum(f64::NAN).is_nan());
10011008 /// ```
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.
10091009 #[ must_use = "this returns the result of the comparison, without modifying either input" ]
10101010 #[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
10111011 #[ inline]
0 commit comments