numaxiom 0.0.2

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

/// Provides the value `2` as a method.
pub trait Two: HasTwo {
    fn two() -> Self;
}

macro_rules! impl_two {
    ($($ty:ty),+ $(,)?) => {
        $(
            impl Two for $ty {
                fn two() -> Self {
                    2 as $ty
                }
            }

        )+
    };
}

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