numaxiom 0.0.2

Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional.
Documentation
/// Supplies a checked negation that returns `None` on overflow.
pub trait CheckedNeg {
    type Output;

    fn checked_neg(self) -> Option<Self::Output>;
}

macro_rules! impl_checked_neg {
    ($($ty:ty),+ $(,)?) => {
        $(impl CheckedNeg for $ty {
            type Output = $ty;

            #[inline]
            fn checked_neg(self) -> Option<Self::Output> {
                <$ty>::checked_neg(self)
            }
        })+
    };
}

impl_checked_neg!(i8, i16, i32, i64, i128, isize);