Skip to content

Commit

Permalink
Add NAN examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Aug 26, 2017
1 parent c589f86 commit f74c5d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ impl f32 {
/// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
/// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
/// assert!((NAN).clamp(-2.0f32, 1.0f32) == NAN);
/// ```
#[unstable(feature = "clamp", issue = "44095")]
#[inline]
Expand Down
1 change: 1 addition & 0 deletions src/libstd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ impl f64 {
/// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64);
/// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64);
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
/// assert!((NAN).clamp(-2.0f64, 1.0f64) == NAN);
/// ```
#[unstable(feature = "clamp", issue = "44095")]
#[inline]
Expand Down

0 comments on commit f74c5d2

Please sign in to comment.