use super::{super::family::define_integer_family, *};
use crate::number::traits::{
ConstLowerBounded, ConstOne, ConstUpperBounded, ConstZero, LowerBounded, NonNegative, One,
Positive, UpperBounded, Zero,
};
define_integer_family![build_variants:
NonNegativeIntegers, "The family of [non-negative integers][super], also known as [`Nnz`][super::Nnz].",
common:
NonNegativeInteger+8, NonNegativeInteger+16, NonNegativeInteger+32, NonNegativeInteger+64,
NonNegativeInteger+128
;
depending:
Big, NonNegativeIntegerBig, "dashu-int-TODO" ];
impl Positive for NonNegativeIntegers {}
impl NonNegative for NonNegativeIntegers {}
impl Zero for NonNegativeIntegers {
#[inline]
fn new_zero() -> Self {
NonNegativeInteger8::new_zero().into()
}
}
impl One for NonNegativeIntegers {
#[inline]
fn new_one() -> Self {
NonNegativeInteger8::new_one().into()
}
}
impl ConstZero for NonNegativeIntegers {
const ZERO: Self = NonNegativeIntegers::_8(NonNegativeInteger8::ZERO);
}
impl ConstOne for NonNegativeIntegers {
const ONE: Self = NonNegativeIntegers::_8(NonNegativeInteger8::ONE);
}
impl LowerBounded for NonNegativeIntegers {
#[inline]
fn new_min() -> Self {
NonNegativeInteger8::new_min().into()
}
}
impl UpperBounded for NonNegativeIntegers {
#[inline]
fn new_max() -> Self {
NonNegativeInteger128::new_max().into()
}
}
impl ConstLowerBounded for NonNegativeIntegers {
const MIN: Self = NonNegativeIntegers::_8(NonNegativeInteger8::MIN);
}
impl ConstUpperBounded for NonNegativeIntegers {
const MAX: Self = NonNegativeIntegers::_128(NonNegativeInteger128::MAX);
}