1use crate::nightly::impl_const;
2use core::cmp::{Ord, Ordering, PartialOrd};
3
4macro_rules! cmp {
5 ($BUint: ident, $BInt: ident, $Digit: ident) => {
6 impl_const! {
18 impl<const N: usize> const PartialOrd for $BInt<N> {
19 #[inline]
20 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
21 Some(self.cmp(other))
22 }
23 }
24 }
25
26 impl_const! {
27 impl<const N: usize> const Ord for $BInt<N> {
28 #[inline]
29 fn cmp(&self, other: &Self) -> Ordering {
30 Self::cmp(self, other)
31 }
32
33 #[inline]
34 fn max(self, other: Self) -> Self {
35 Self::max(self, other)
36 }
37
38 #[inline]
39 fn min(self, other: Self) -> Self {
40 Self::min(self, other)
41 }
42
43 #[inline]
44 fn clamp(self, min: Self, max: Self) -> Self {
45 Self::clamp(self, min, max)
46 }
47 }
48 }
49 };
50}
51
52crate::macro_impl!(cmp);