@@ -689,7 +689,7 @@ impl f32 {
689
689
self * ( value / 180.0f32 )
690
690
}
691
691
692
- /// Returns the maximum of the two numbers.
692
+ /// Returns the maximum of the two numbers, ignoring NaN .
693
693
///
694
694
/// If one of the arguments is NaN, then the other argument is returned.
695
695
/// This follows the IEEE-754 2008 semantics for maxNum, except for handling of signaling NaNs;
@@ -709,7 +709,7 @@ impl f32 {
709
709
intrinsics:: maxnumf32 ( self , other)
710
710
}
711
711
712
- /// Returns the minimum of the two numbers.
712
+ /// Returns the minimum of the two numbers, ignoring NaN .
713
713
///
714
714
/// If one of the arguments is NaN, then the other argument is returned.
715
715
/// This follows the IEEE-754 2008 semantics for minNum, except for handling of signaling NaNs;
@@ -729,7 +729,7 @@ impl f32 {
729
729
intrinsics:: minnumf32 ( self , other)
730
730
}
731
731
732
- /// Returns the maximum of the two numbers.
732
+ /// Returns the maximum of the two numbers, propagating NaN .
733
733
///
734
734
/// This returns NaN when *either* argument is NaN, as opposed to
735
735
/// [`f32::max`] which only returns NaN when *both* arguments are NaN.
@@ -746,6 +746,9 @@ impl f32 {
746
746
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
747
747
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
748
748
/// Note that this follows the semantics specified in IEEE 754-2019.
749
+ ///
750
+ /// Also note that "propagation" of NaNs here doesn't mean that the bitpattern of a NaN operand
751
+ /// is necessarily conserved; see [explanation of NaN as a special value](f32) for more info.
749
752
#[ must_use = "this returns the result of the comparison, without modifying either input" ]
750
753
#[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
751
754
#[ inline]
@@ -761,7 +764,7 @@ impl f32 {
761
764
}
762
765
}
763
766
764
- /// Returns the minimum of the two numbers.
767
+ /// Returns the minimum of the two numbers, propagating NaN .
765
768
///
766
769
/// This returns NaN when *either* argument is NaN, as opposed to
767
770
/// [`f32::min`] which only returns NaN when *both* arguments are NaN.
@@ -778,6 +781,9 @@ impl f32 {
778
781
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
779
782
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
780
783
/// Note that this follows the semantics specified in IEEE 754-2019.
784
+ ///
785
+ /// Also note that "propagation" of NaNs here doesn't mean that the bitpattern of a NaN operand
786
+ /// is necessarily conserved; see [explanation of NaN as a special value](f32) for more info.
781
787
#[ must_use = "this returns the result of the comparison, without modifying either input" ]
782
788
#[ unstable( feature = "float_minimum_maximum" , issue = "91079" ) ]
783
789
#[ inline]
0 commit comments