Skip to content

Commit

Permalink
factor::numeric::DoubleInt: Document the DoubleWidth associated type
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Jul 21, 2020
1 parent 141d813 commit 33a1c44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/uu/factor/src/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,15 @@ pub(crate) trait Int:
{
fn as_u64(&self) -> u64;
fn from_u64(n: u64) -> Self;

#[cfg(debug_assertions)]
fn as_u128(&self) -> u128;
}

pub(crate) trait DoubleInt: Int {
/// An integer type with twice the width of `Self`.
/// In particular, multiplications (of `Int` values) can be performed in
/// `Self::DoubleWidth` without possibility of overflow.
type DoubleWidth: Int;

fn as_double_width(self) -> Self::DoubleWidth;
Expand Down

0 comments on commit 33a1c44

Please sign in to comment.