Trait gardiz::bits::HalfExcess

source ·
pub trait HalfExcesswhere
    Self: Unsigned + Bounded,{
    // Required method
    fn half_excess() -> Self;
}
Expand description

Trait for getting the “excess” that is the half of an unsigned type’s maximum value, typically 1000...0000. Types should not worry with this trait, but instead implement Unsigned and Bounded, since there is a blank implementation for them, and there is no other way to implement the trait (Unsigned and Bounded are super traits of this trait).

Required Methods§

source

fn half_excess() -> Self

Gets the “excess” that is the half of the maximum value of an unsigned type.

Implementors§

source§

impl<N> HalfExcess for Nwhere N: Unsigned + Bounded,