Trait number_general::NumberInstance[][src]

pub trait NumberInstance: Copy + Default + Sized + From<Boolean> + Into<Number> + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + Mul<Output = Self> + MulAssign + Div<Output = Self> + DivAssign + Product + Sum + Debug + Display {
    type Abs: NumberInstance;
    type Exp: NumberInstance;
    type Class: NumberClass<Instance = Self>;
    fn class(&self) -> Self::Class;
fn into_type(
        self,
        dtype: <Self as NumberInstance>::Class
    ) -> <<Self as NumberInstance>::Class as NumberClass>::Instance;
fn abs(self) -> Self::Abs;
fn exp(self) -> Self::Exp;
fn pow(self, exp: Number) -> Self; fn and(self, other: Self) -> Self
    where
        Boolean: CastFrom<Self>
, { ... }
fn not(self) -> Self
    where
        Boolean: CastFrom<Self>
, { ... }
fn or(self, other: Self) -> Self
    where
        Boolean: CastFrom<Self>
, { ... }
fn xor(self, other: Self) -> Self
    where
        Boolean: CastFrom<Self>
, { ... } }
Expand description

Defines common operations on numeric types supported by Number.

Associated Types

Required methods

Get an impl of NumberClass describing this number.

Cast this number into the specified NumberClass.

Calculate the absolute value of this number.

Raise e to the power of this number.

Raise this number to the given exponent.

Panics: if the given exponent is a complex number.

Provided methods

Return true if self and other are nonzero.

Return true if this number is zero.

Return true if self or other is nonzero.

Return true if exactly one of self and other is zero.

Implementors