pub trait Maximum: Sized {
type Output;
// Required method
fn maximum(self, other: Self) -> Self::Output;
}Expand description
IEEE 754-2019 maximum (NaN-propagating, unlike max).
Required Associated Types§
Sourcetype Output
type Output
Returns the greater of two numbers, propagating NaN and treating
+0.0 as greater than -0.0 — the IEEE 754-2019 maximum
operation, in contrast to max which ignores NaN.
use const_num_traits::Maximum;
assert_eq!(Maximum::maximum(1.0f32, 2.0), 2.0);
assert!(Maximum::maximum(1.0f32, f32::NAN).is_nan());Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".