use super::{super::family::define_integer_family, *};
use crate::number::traits::{
ConstLowerBounded, ConstOne, ConstUpperBounded, LowerBounded, NonNegative, NonZero, One,
Positive, UpperBounded,
};
define_integer_family![build_variants:
PositiveIntegers,
"The family of [positive integers][super], also known as [`Pz`][super::Pz].",
common:
PositiveInteger+8, PositiveInteger+16, PositiveInteger+32, PositiveInteger+64,
PositiveInteger+128
;
depending:
Big, PositiveIntegerBig, "dashu-int-TODO" ];
impl NonNegative for PositiveIntegers {}
impl Positive for PositiveIntegers {}
impl NonZero for PositiveIntegers {}
impl One for PositiveIntegers {
#[inline]
fn new_one() -> Self {
PositiveInteger8::new_one().into()
}
}
impl ConstOne for PositiveIntegers {
const ONE: Self = PositiveIntegers::_8(PositiveInteger8::ONE);
}
impl LowerBounded for PositiveIntegers {
#[inline]
fn new_min() -> Self {
PositiveInteger8::new_min().into()
}
}
impl UpperBounded for PositiveIntegers {
#[inline]
fn new_max() -> Self {
PositiveInteger128::new_max().into()
}
}
impl ConstLowerBounded for PositiveIntegers {
const MIN: Self = PositiveIntegers::_8(PositiveInteger8::MIN);
}
impl ConstUpperBounded for PositiveIntegers {
const MAX: Self = PositiveIntegers::_128(PositiveInteger128::MAX);
}