1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

factor::numeric::DoubleInt: Document the DoubleWidth associated type

This commit is contained in:
nicoo 2020-07-21 19:49:57 +02:00 committed by Roy Ivy III
parent 17c69674eb
commit 9a80ab7741

View file

@ -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;