numaxiom 0.0.2

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

/// Provides the additive identity (`0`) as an associated constant.
pub trait ZeroConst: HasZero {
    const ZERO: Self;
}

macro_rules! impl_zero_const {
    ($($ty:ty),+ $(,)?) => {
        $(
            impl ZeroConst for $ty {
                const ZERO: Self = 0 as $ty;
            }
        )+
    };
}

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