Struct deranged::I64 [−][src]
Expand description
An i64
that is known to be in the range MIN..=MAX
.
Implementations
Creates a ranged integer without checking the value.
Safety
The value must be within the range MIN..=MAX
.
Creates a ranged integer if the given value is in the range
MIN..=MAX
.
Checked integer addition. Computes self + rhs
, returning
None
if the resulting value is out of range.
Checked integer addition. Computes self - rhs
, returning
None
if the resulting value is out of range.
Checked integer addition. Computes self * rhs
, returning
None
if the resulting value is out of range.
Checked integer addition. Computes self / rhs
, returning
None
if rhs == 0
or if the resulting value is out of range.
Checked Euclidean division. Computes self.div_euclid(rhs)
,
returning None
if rhs == 0
or if the resulting value is out
of range.
Checked integer remainder. Computes self % rhs
, returning
None
if rhs == 0
or if the resulting value is out of range.
Checked Euclidean remainder. Computes self.rem_euclid(rhs)
,
returning None
if rhs == 0
or if the resulting value is out
of range.
Checked negation. Computes -self
, returning None
if the
resulting value is out of range.
Checked shift left. Computes self << rhs
, returning None
if
the resulting value is out of range.
Checked shift right. Computes self >> rhs
, returning None
if
the resulting value is out of range.
Checked absolute value. Computes self.abs()
, returning None
if the resulting value is out of range.
Checked exponentiation. Computes self.pow(exp)
, returning
None
if the resulting value is out of range.
Saturating integer addition. Computes self + rhs
, saturating
at the numeric bounds.
Saturating integer subtraction. Computes self - rhs
,
saturating at the numeric bounds.
Saturating integer negation. Computes self - rhs
, saturating
at the numeric bounds.
Saturating absolute value. Computes self.abs()
, saturating at
the numeric bounds.
Saturating integer multiplication. Computes self * rhs
,
saturating at the numeric bounds.
Saturating integer exponentiation. Computes self.pow(exp)
,
saturating at the numeric bounds.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<const MIN: i64, const MAX: i64> RefUnwindSafe for I64<MIN, MAX>
impl<const MIN: i64, const MAX: i64> UnwindSafe for I64<MIN, MAX>
Blanket Implementations
Mutably borrows from an owned value. Read more