numaxiom 0.0.2

Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional.
Documentation
use super::HasMaxValue;

/// Provides the largest representable value for the type.
pub trait MaxValue: HasMaxValue {
    fn max_value() -> Self;
}

macro_rules! impl_max_value {
    ($($ty:ty),+ $(,)?) => {
        $(
            impl MaxValue for $ty {
                fn max_value() -> Self {
                    <$ty>::MAX
                }
            }
        )+
    };
}

impl_max_value!(i8, i16, i32, i64, i128, isize);
impl_max_value!(u8, u16, u32, u64, u128, usize);
impl_max_value!(f32, f64);