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; pub fn class(&self) -> Self::Class; pub fn into_type(
self,
dtype: Self::Class
) -> <Self::Class as NumberClass>::Instance; pub fn abs(self) -> Self::Abs; pub fn pow(self, exp: Self::Exp) -> Self; pub fn and(self, other: Self) -> Self
where
Boolean: CastFrom<Self>, { ... } pub fn not(self) -> Self
where
Boolean: CastFrom<Self>, { ... } pub fn or(self, other: Self) -> Self
where
Boolean: CastFrom<Self>, { ... } pub fn xor(self, other: Self) -> Self
where
Boolean: CastFrom<Self>, { ... } }
Defines common operations on numeric types supported by Number
.
Associated Types
Loading content...Required methods
pub fn class(&self) -> Self::Class
[src]
Get an impl of NumberClass
describing this number.
pub fn into_type(
self,
dtype: Self::Class
) -> <Self::Class as NumberClass>::Instance
[src]
self,
dtype: Self::Class
) -> <Self::Class as NumberClass>::Instance
Cast this number into the specified NumberClass
.
pub fn abs(self) -> Self::Abs
[src]
Calculate the absolute value of this number.
pub fn pow(self, exp: Self::Exp) -> Self
[src]
Raise this number to the given exponent.
Provided methods
pub fn and(self, other: Self) -> Self where
Boolean: CastFrom<Self>,
[src]
Boolean: CastFrom<Self>,
Return true
if self
and other
are nonzero.
pub fn not(self) -> Self where
Boolean: CastFrom<Self>,
[src]
Boolean: CastFrom<Self>,
Return true
if this number is zero.
pub fn or(self, other: Self) -> Self where
Boolean: CastFrom<Self>,
[src]
Boolean: CastFrom<Self>,
Return true
if self
or other
is nonzero.
pub fn xor(self, other: Self) -> Self where
Boolean: CastFrom<Self>,
[src]
Boolean: CastFrom<Self>,
Return true
if exactly one of self
and other
is zero.
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]