Skip to content

Commit 6e97b16

Browse files
committed
Rollup merge of #25951 - mbrubeck:nan, r=alexcrichton
This is based on the documented behavior of cmath::{fmin,fmax}. It is also tested by existing unit tests in this module.
2 parents ce3bc8d + f44d287 commit 6e97b16

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/libstd/num/f32.rs

+4
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ impl f32 {
660660
///
661661
/// assert_eq!(x.max(y), y);
662662
/// ```
663+
///
664+
/// If one of the arguments is NaN, then the other argument is returned.
663665
#[stable(feature = "rust1", since = "1.0.0")]
664666
#[inline]
665667
pub fn max(self, other: f32) -> f32 {
@@ -674,6 +676,8 @@ impl f32 {
674676
///
675677
/// assert_eq!(x.min(y), x);
676678
/// ```
679+
///
680+
/// If one of the arguments is NaN, then the other argument is returned.
677681
#[stable(feature = "rust1", since = "1.0.0")]
678682
#[inline]
679683
pub fn min(self, other: f32) -> f32 {

src/libstd/num/f64.rs

+4
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ impl f64 {
636636
///
637637
/// assert_eq!(x.max(y), y);
638638
/// ```
639+
///
640+
/// If one of the arguments is NaN, then the other argument is returned.
639641
#[stable(feature = "rust1", since = "1.0.0")]
640642
#[inline]
641643
pub fn max(self, other: f64) -> f64 {
@@ -650,6 +652,8 @@ impl f64 {
650652
///
651653
/// assert_eq!(x.min(y), x);
652654
/// ```
655+
///
656+
/// If one of the arguments is NaN, then the other argument is returned.
653657
#[stable(feature = "rust1", since = "1.0.0")]
654658
#[inline]
655659
pub fn min(self, other: f64) -> f64 {

0 commit comments

Comments
 (0)