numaxiom 0.0.2

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

/// Provides the multiplicative identity (`1`) as an associated constant.
pub trait OneConst: HasOne {
    const ONE: Self;
}

macro_rules! impl_one_const {
    ($($ty:ty),+ $(,)?) => {
        $(
            impl OneConst for $ty {
                const ONE: Self = 1 as $ty;
            }
        )+
    };
}

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