NonPositive

Trait NonPositive 

Source
pub trait NonPositive: Sign {
    type InnerRepr;

    // Required method
    fn new_neg(value: Self::InnerRepr) -> NumeraResult<Self>
       where Self: Sized;
}
Expand description

A number that can not represent positive numbers.

This trait is mutually exclusive with Signed and Positive.

Required Associated Types§

Source

type InnerRepr

The number’s inner constituent parts.

Required Methods§

Source

fn new_neg(value: Self::InnerRepr) -> NumeraResult<Self>
where Self: Sized,

Returns a new number that contains the negation of the value.

This allows using an unsigned type value to store only negative numbers.

§Errors

If the given value doesn’t maintain the expected invariances for the concrete type.

Implementors§