Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/uint/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ macro_rules! impl_uint_concat_split_even {
{
type Output = Uint<{ <$name>::LIMBS / 2 }>;
}

impl $name {
/// Split this number in half, returning its low and high components respectively.
pub const fn split(&self) -> (Uint<{ <$name>::LIMBS / 2 }>, Uint<{ <$name>::LIMBS / 2 }>) {
self.split_mixed()
}
}
};
($($name:ident,)+) => {
$(
Expand Down
10 changes: 9 additions & 1 deletion src/uint/split.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use crate::{Limb, SplitMixed, Uint};
use crate::{Limb, Split, SplitMixed, Uint};

impl<const I: usize> Uint<I> {
/// Split this number in half into low and high components.
pub const fn split<const O: usize>(&self) -> (Uint<O>, Uint<O>)
where
Self: Split<Output = Uint<O>>,
{
self.split_mixed()
}

/// Split this number into low and high components respectively.
#[inline]
pub const fn split_mixed<const L: usize, const H: usize>(&self) -> (Uint<L>, Uint<H>)
Expand Down