Skip to main content

fastnum/bint/int/
strict.rs

1use crate::bint::{doc, int::intrinsics::*, strict::strict_impl, Int, UInt};
2
3strict_impl!(Int, I);
4
5#[doc = doc::strict::impl_desc!()]
6impl<const N: usize> Int<N> {
7    #[doc = doc::strict::strict_abs!(I 256)]
8    #[must_use = doc::must_use_op!()]
9    #[inline]
10    pub const fn strict_abs(self) -> Self {
11        Self(self.0.strict_abs())
12    }
13
14    #[doc = doc::strict::strict_mul!(I 256)]
15    #[must_use = doc::must_use_op!()]
16    #[inline(always)]
17    pub const fn strict_mul(self, rhs: Self) -> Self {
18        Self(self.0.strict_mul(rhs.0))
19    }
20
21    #[doc = doc::strict::strict_add_unsigned!(I 256)]
22    #[must_use = doc::must_use_op!()]
23    #[inline]
24    pub const fn strict_add_unsigned(self, rhs: UInt<N>) -> Self {
25        Self(self.0.strict_add_unsigned(rhs.0))
26    }
27
28    #[doc = doc::strict::strict_sub_unsigned!(I 256)]
29    #[must_use = doc::must_use_op!()]
30    #[inline]
31    pub const fn strict_sub_unsigned(self, rhs: UInt<N>) -> Self {
32        Self(self.0.strict_sub_unsigned(rhs.0))
33    }
34}