Trait tc_value::NumberInstance [−][src]
pub trait NumberInstance: Copy + Default + From<Boolean> + Into<Number> + Add<Self, Output = Self> + AddAssign<Self> + Sub<Self, Output = Self> + SubAssign<Self> + Mul<Self, Output = Self> + MulAssign<Self> + Div<Self, Output = Self> + DivAssign<Self> + Product<Self> + Sum<Self> + Debug + Display { type Abs: NumberInstance; type Exp: NumberInstance; type Class: NumberClass; fn class(&self) -> Self::Class; fn into_type(
self,
dtype: Self::Class
) -> <Self::Class as NumberClass>::Instance; fn abs(self) -> Self::Abs; fn pow(self, exp: Self::Exp) -> 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
fn class(&self) -> Self::Class[src]
fn class(&self) -> Self::Class[src]Get an impl of NumberClass describing this number.
fn into_type(self, dtype: Self::Class) -> <Self::Class as NumberClass>::Instance[src]
fn into_type(self, dtype: Self::Class) -> <Self::Class as NumberClass>::Instance[src]Cast this number into the specified NumberClass.
Provided methods
fn and(self, other: Self) -> Self where
Boolean: CastFrom<Self>, [src]
fn and(self, other: Self) -> Self where
Boolean: CastFrom<Self>, [src]Return true if self and other are nonzero.
Implementors
impl NumberInstance for Complex[src]
impl NumberInstance for Complex[src]impl NumberInstance for Float[src]
impl NumberInstance for Float[src]impl NumberInstance for Int[src]
impl NumberInstance for Int[src]impl NumberInstance for Number[src]
impl NumberInstance for Number[src]impl NumberInstance for UInt[src]
impl NumberInstance for UInt[src]impl NumberInstance for Boolean[src]
impl NumberInstance for Boolean[src]