Skip to content

Commit f74c5d2

Browse files
committed
Add NAN examples
1 parent c589f86 commit f74c5d2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libstd/f32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ impl f32 {
10891089
/// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
10901090
/// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
10911091
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
1092+
/// assert!((NAN).clamp(-2.0f32, 1.0f32) == NAN);
10921093
/// ```
10931094
#[unstable(feature = "clamp", issue = "44095")]
10941095
#[inline]

src/libstd/f64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ impl f64 {
979979
/// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64);
980980
/// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64);
981981
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
982+
/// assert!((NAN).clamp(-2.0f64, 1.0f64) == NAN);
982983
/// ```
983984
#[unstable(feature = "clamp", issue = "44095")]
984985
#[inline]

0 commit comments

Comments
 (0)