pub trait MaxMin: PartialOrd {
// Required methods
fn get_max(self, other: Self) -> Self;
fn get_min(self, other: Self) -> Self;
fn non_zero_positive_min_value() -> Self;
}
Required Methods§
Sourcefn get_max(self, other: Self) -> Self
fn get_max(self, other: Self) -> Self
Returns the maximum of two numbers.
§Examples
use hyperloglog_rs::prelude::*;
let max = 2.0_f32.max(3.0_f32);
assert_eq!(max, 3.0_f32);
Sourcefn get_min(self, other: Self) -> Self
fn get_min(self, other: Self) -> Self
Returns the minimum of two numbers.
§Examples
use hyperloglog_rs::prelude::*;
let min = 2.0_f32.min(3.0_f32);
assert_eq!(min, 2.0_f32);
Sourcefn non_zero_positive_min_value() -> Self
fn non_zero_positive_min_value() -> Self
Returns the non-zero positive minimum value that can be represented by this type.
§Examples
use hyperloglog_rs::prelude::*;
let min = f32::non_zero_positive_min_value();
assert_eq!(min, f32::EPSILON);
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.