[−][src]Function partial_min_max::min
pub fn min<T: PartialOrd>(a: T, b: T) -> T
A version of std::cmp::min
that works with PartialOrd
types.
If a < b
return a
, otherwise return b
.
Example
use partial_min_max::min; use std::f32::NAN; assert_eq!(min(0.0, 1.0), 0.0); assert!(min(0.0, NAN).is_nan()); assert_eq!(min(NAN, 0.0), 0.0);