summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-06-02 11:14:09 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-06-02 11:14:09 +0530
commit6e97b16d0277d86fb06a158683ef3c15ece14a62 (patch)
treecbaf9988fa73a3e23e98f7cc21a7fc540397ae7e /src/libstd
parentce3bc8d884148f2190411cd4be9247b6457bffd2 (diff)
parentf44d287a769765862518c0de82d87bef4cca2670 (diff)
downloadrust-6e97b16d0277d86fb06a158683ef3c15ece14a62.tar.gz
rust-6e97b16d0277d86fb06a158683ef3c15ece14a62.zip
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.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/num/f32.rs4
-rw-r--r--src/libstd/num/f64.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index e31d97b3240..c22f5d073de 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -660,6 +660,8 @@ impl f32 {
     ///
     /// assert_eq!(x.max(y), y);
     /// ```
+    ///
+    /// If one of the arguments is NaN, then the other argument is returned.
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn max(self, other: f32) -> f32 {
@@ -674,6 +676,8 @@ impl f32 {
     ///
     /// assert_eq!(x.min(y), x);
     /// ```
+    ///
+    /// If one of the arguments is NaN, then the other argument is returned.
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn min(self, other: f32) -> f32 {
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index e87855ffd4e..cde0b567ade 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -636,6 +636,8 @@ impl f64 {
     ///
     /// assert_eq!(x.max(y), y);
     /// ```
+    ///
+    /// If one of the arguments is NaN, then the other argument is returned.
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn max(self, other: f64) -> f64 {
@@ -650,6 +652,8 @@ impl f64 {
     ///
     /// assert_eq!(x.min(y), x);
     /// ```
+    ///
+    /// If one of the arguments is NaN, then the other argument is returned.
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn min(self, other: f64) -> f64 {