Enum number_general::Int
source · [−]Expand description
A signed integer.
Variants
I8(i8)
I16(i16)
I32(i32)
I64(i64)
Trait Implementations
sourceimpl AddAssign<Int> for Int
impl AddAssign<Int> for Int
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl DivAssign<Int> for Int
impl DivAssign<Int> for Int
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /=
operation. Read more
sourceimpl MulAssign<Int> for Int
impl MulAssign<Int> for Int
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *=
operation. Read more
sourceimpl NumberInstance for Int
impl NumberInstance for Int
type Abs = Self
type Exp = Float
type Log = Float
type Round = Self
type Class = IntType
sourcefn class(&self) -> IntType
fn class(&self) -> IntType
Get an impl of NumberClass
describing this number.
sourcefn into_type(self, dtype: IntType) -> Int
fn into_type(self, dtype: IntType) -> Int
Cast this number into the specified NumberClass
.
sourcefn log<N: NumberInstance>(self, base: N) -> Self::Log where
Float: From<N>,
fn log<N: NumberInstance>(self, base: N) -> Self::Log where
Float: From<N>,
Compute the logarithm of this number with respect to the given base
.
sourcefn and(self, other: Self) -> Self where
Boolean: CastFrom<Self>,
fn and(self, other: Self) -> Self where
Boolean: CastFrom<Self>,
Return true
if self
and other
are nonzero.
sourceimpl Ord for Int
impl Ord for Int
sourceimpl PartialOrd<Int> for Int
impl PartialOrd<Int> for Int
sourcefn partial_cmp(&self, other: &Int) -> Option<Ordering>
fn partial_cmp(&self, other: &Int) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl RealInstance for Int
impl RealInstance for Int
sourceimpl RemAssign<Int> for Int
impl RemAssign<Int> for Int
sourcefn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the %=
operation. Read more
sourceimpl SubAssign<Int> for Int
impl SubAssign<Int> for Int
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl Trigonometry for Int
impl Trigonometry for Int
impl Copy for Int
impl Eq for Int
Auto Trait Implementations
impl RefUnwindSafe for Int
impl Send for Int
impl Sync for Int
impl Unpin for Int
impl UnwindSafe for Int
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.