Add NAN examples
This commit is contained in:
@@ -1089,6 +1089,7 @@ impl f32 {
|
|||||||
/// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
|
/// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
|
||||||
/// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
|
/// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
|
||||||
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
|
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
|
||||||
|
/// assert!((NAN).clamp(-2.0f32, 1.0f32) == NAN);
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "clamp", issue = "44095")]
|
#[unstable(feature = "clamp", issue = "44095")]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -979,6 +979,7 @@ impl f64 {
|
|||||||
/// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64);
|
/// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64);
|
||||||
/// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64);
|
/// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64);
|
||||||
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
|
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
|
||||||
|
/// assert!((NAN).clamp(-2.0f64, 1.0f64) == NAN);
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "clamp", issue = "44095")]
|
#[unstable(feature = "clamp", issue = "44095")]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
Reference in New Issue
Block a user