Trait fixed::traits::FixedStrict
source · pub trait FixedStrict: Fixedwhere
Self: Display + LowerExp + UpperExp + Binary + Octal + LowerHex + UpperHex + FromStr<Err = ParseFixedError> + Div<Output = Self> + DivAssign + Rem<<Self as Fixed>::Bits, Output = Self> + RemAssign<<Self as Fixed>::Bits> + Rem<<Self as Fixed>::NonZeroBits, Output = Self> + RemAssign<<Self as Fixed>::NonZeroBits> + FixedStrictOptionalNum + FixedStrictOptionalSerdeStr,{
Show 66 methods
// Required methods
fn from_str_binary(src: &str) -> Result<Self, ParseFixedError>;
fn from_str_octal(src: &str) -> Result<Self, ParseFixedError>;
fn from_str_hex(src: &str) -> Result<Self, ParseFixedError>;
fn saturating_from_str(src: &str) -> Result<Self, ParseFixedError>;
fn saturating_from_str_binary(src: &str) -> Result<Self, ParseFixedError>;
fn saturating_from_str_octal(src: &str) -> Result<Self, ParseFixedError>;
fn saturating_from_str_hex(src: &str) -> Result<Self, ParseFixedError>;
fn wrapping_from_str(src: &str) -> Result<Self, ParseFixedError>;
fn wrapping_from_str_binary(src: &str) -> Result<Self, ParseFixedError>;
fn wrapping_from_str_octal(src: &str) -> Result<Self, ParseFixedError>;
fn wrapping_from_str_hex(src: &str) -> Result<Self, ParseFixedError>;
fn unwrapped_from_str(src: &str) -> Self;
fn unwrapped_from_str_binary(src: &str) -> Self;
fn unwrapped_from_str_octal(src: &str) -> Self;
fn unwrapped_from_str_hex(src: &str) -> Self;
fn overflowing_from_str(src: &str) -> Result<(Self, bool), ParseFixedError>;
fn overflowing_from_str_binary(
src: &str
) -> Result<(Self, bool), ParseFixedError>;
fn overflowing_from_str_octal(
src: &str
) -> Result<(Self, bool), ParseFixedError>;
fn overflowing_from_str_hex(
src: &str
) -> Result<(Self, bool), ParseFixedError>;
fn int_log10(self) -> i32;
fn int_log(self, base: u32) -> i32;
fn checked_int_log10(self) -> Option<i32>;
fn checked_int_log(self, base: u32) -> Option<i32>;
fn recip(self) -> Self;
fn div_euclid(self, rhs: Self) -> Self;
fn div_euclid_int(self, rhs: Self::Bits) -> Self;
fn rem_euclid_int(self, rhs: Self::Bits) -> Self;
fn lerp(self, start: Self, end: Self) -> Self;
fn overflowing_div(self, rhs: Self) -> (Self, bool);
fn overflowing_recip(self) -> (Self, bool);
fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool);
fn inv_lerp(self, start: Self, end: Self) -> Self;
fn checked_div(self, rhs: Self) -> Option<Self>;
fn checked_recip(self) -> Option<Self>;
fn checked_div_euclid(self, rhs: Self) -> Option<Self>;
fn checked_rem_int(self, rhs: Self::Bits) -> Option<Self>;
fn checked_div_euclid_int(self, rhs: Self::Bits) -> Option<Self>;
fn checked_rem_euclid_int(self, rhs: Self::Bits) -> Option<Self>;
fn checked_lerp(self, start: Self, end: Self) -> Option<Self>;
fn checked_inv_lerp(self, start: Self, end: Self) -> Option<Self>;
fn saturating_div(self, rhs: Self) -> Self;
fn saturating_recip(self) -> Self;
fn saturating_div_euclid(self, rhs: Self) -> Self;
fn saturating_div_euclid_int(self, rhs: Self::Bits) -> Self;
fn saturating_rem_euclid_int(self, rhs: Self::Bits) -> Self;
fn saturating_lerp(self, start: Self, end: Self) -> Self;
fn saturating_inv_lerp(self, start: Self, end: Self) -> Self;
fn wrapping_div(self, rhs: Self) -> Self;
fn wrapping_recip(self) -> Self;
fn wrapping_div_euclid(self, rhs: Self) -> Self;
fn wrapping_div_euclid_int(self, rhs: Self::Bits) -> Self;
fn wrapping_rem_euclid_int(self, rhs: Self::Bits) -> Self;
fn wrapping_lerp(self, start: Self, end: Self) -> Self;
fn wrapping_inv_lerp(self, start: Self, end: Self) -> Self;
fn unwrapped_div(self, rhs: Self) -> Self;
fn unwrapped_recip(self) -> Self;
fn unwrapped_div_euclid(self, rhs: Self) -> Self;
fn unwrapped_rem_int(self, rhs: Self::Bits) -> Self;
fn unwrapped_div_euclid_int(self, rhs: Self::Bits) -> Self;
fn unwrapped_rem_euclid_int(self, rhs: Self::Bits) -> Self;
fn unwrapped_lerp(self, start: Self, end: Self) -> Self;
fn unwrapped_inv_lerp(self, start: Self, end: Self) -> Self;
fn overflowing_div_euclid_int(self, rhs: Self::Bits) -> (Self, bool);
fn overflowing_rem_euclid_int(self, rhs: Self::Bits) -> (Self, bool);
fn overflowing_lerp(self, start: Self, end: Self) -> (Self, bool);
fn overflowing_inv_lerp(self, start: Self, end: Self) -> (Self, bool);
}
Expand description
This trait provides methods common to fixed-point numbers where the number of fractional bits is from zero to the total number of bits.
This trait is sealed and cannot be implemented for more types; it
is implemented for FixedI8
, FixedI16
, FixedI32
,
FixedI64
, FixedI128
, FixedU8
, FixedU16
,
FixedU32
, FixedU64
, and FixedU128
.
Required Methods§
sourcefn from_str_binary(src: &str) -> Result<Self, ParseFixedError>
fn from_str_binary(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing binary digits to return a fixed-point number.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::from_str_binary
and
FixedU32::from_str_binary
.
sourcefn from_str_octal(src: &str) -> Result<Self, ParseFixedError>
fn from_str_octal(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing octal digits to return a fixed-point number.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::from_str_octal
and
FixedU32::from_str_octal
.
sourcefn from_str_hex(src: &str) -> Result<Self, ParseFixedError>
fn from_str_hex(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing hexadecimal digits to return a fixed-point number.
Rounding is to the nearest, with ties rounded to even.
See also FixedI32::from_str_hex
and FixedU32::from_str_hex
.
sourcefn saturating_from_str(src: &str) -> Result<Self, ParseFixedError>
fn saturating_from_str(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing decimal digits to return a fixed-point number, saturating on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::saturating_from_str
and
FixedU32::saturating_from_str
.
sourcefn saturating_from_str_binary(src: &str) -> Result<Self, ParseFixedError>
fn saturating_from_str_binary(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing binary digits to return a fixed-point number, saturating on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::saturating_from_str_binary
and
FixedU32::saturating_from_str_binary
.
sourcefn saturating_from_str_octal(src: &str) -> Result<Self, ParseFixedError>
fn saturating_from_str_octal(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing octal digits to return a fixed-point number, saturating on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::saturating_from_str_octal
and
FixedU32::saturating_from_str_octal
.
sourcefn saturating_from_str_hex(src: &str) -> Result<Self, ParseFixedError>
fn saturating_from_str_hex(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing hexadecimal digits to return a fixed-point number, saturating on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::saturating_from_str_hex
and
FixedU32::saturating_from_str_hex
.
sourcefn wrapping_from_str(src: &str) -> Result<Self, ParseFixedError>
fn wrapping_from_str(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing decimal digits to return a fixed-point number, wrapping on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::wrapping_from_str
and
FixedU32::wrapping_from_str
.
sourcefn wrapping_from_str_binary(src: &str) -> Result<Self, ParseFixedError>
fn wrapping_from_str_binary(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing binary digits to return a fixed-point number, wrapping on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::wrapping_from_str_binary
and
FixedU32::wrapping_from_str_binary
.
sourcefn wrapping_from_str_octal(src: &str) -> Result<Self, ParseFixedError>
fn wrapping_from_str_octal(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing octal digits to return a fixed-point number, wrapping on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::wrapping_from_str_octal
and
FixedU32::wrapping_from_str_octal
.
sourcefn wrapping_from_str_hex(src: &str) -> Result<Self, ParseFixedError>
fn wrapping_from_str_hex(src: &str) -> Result<Self, ParseFixedError>
Parses a string slice containing hexadecimal digits to return a fixed-point number, wrapping on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::wrapping_from_str_hex
and
FixedU32::wrapping_from_str_hex
.
sourcefn unwrapped_from_str(src: &str) -> Self
fn unwrapped_from_str(src: &str) -> Self
Parses a string slice containing decimal digits to return a fixed-point number, panicking on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::unwrapped_from_str
and
FixedU32::unwrapped_from_str
.
Panics
Panics if the value does not fit or if there is a parsing error.
sourcefn unwrapped_from_str_binary(src: &str) -> Self
fn unwrapped_from_str_binary(src: &str) -> Self
Parses a string slice containing binary digits to return a fixed-point number, panicking on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::unwrapped_from_str_binary
and
FixedU32::unwrapped_from_str_binary
.
Panics
Panics if the value does not fit or if there is a parsing error.
sourcefn unwrapped_from_str_octal(src: &str) -> Self
fn unwrapped_from_str_octal(src: &str) -> Self
Parses a string slice containing octal digits to return a fixed-point number, panicking on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::unwrapped_from_str_octal
and
FixedU32::unwrapped_from_str_octal
.
Panics
Panics if the value does not fit or if there is a parsing error.
sourcefn unwrapped_from_str_hex(src: &str) -> Self
fn unwrapped_from_str_hex(src: &str) -> Self
Parses a string slice containing hexadecimal digits to return a fixed-point number, panicking on overflow.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::unwrapped_from_str_hex
and
FixedU32::unwrapped_from_str_hex
.
Panics
Panics if the value does not fit or if there is a parsing error.
sourcefn overflowing_from_str(src: &str) -> Result<(Self, bool), ParseFixedError>
fn overflowing_from_str(src: &str) -> Result<(Self, bool), ParseFixedError>
Parses a string slice containing decimal digits to return a fixed-point number.
Returns a tuple of the fixed-point number and a bool
,
indicating whether an overflow has occurred. On overflow, the
wrapped value is returned.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::overflowing_from_str
and
FixedU32::overflowing_from_str
.
sourcefn overflowing_from_str_binary(
src: &str
) -> Result<(Self, bool), ParseFixedError>
fn overflowing_from_str_binary( src: &str ) -> Result<(Self, bool), ParseFixedError>
Parses a string slice containing binary digits to return a fixed-point number.
Returns a tuple of the fixed-point number and a bool
,
indicating whether an overflow has occurred. On overflow, the
wrapped value is returned.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::overflowing_from_str_binary
and
FixedU32::overflowing_from_str_binary
.
sourcefn overflowing_from_str_octal(
src: &str
) -> Result<(Self, bool), ParseFixedError>
fn overflowing_from_str_octal( src: &str ) -> Result<(Self, bool), ParseFixedError>
Parses a string slice containing octal digits to return a fixed-point number.
Returns a tuple of the fixed-point number and a bool
,
indicating whether an overflow has occurred. On overflow, the
wrapped value is returned.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::overflowing_from_str_octal
and
FixedU32::overflowing_from_str_octal
.
sourcefn overflowing_from_str_hex(src: &str) -> Result<(Self, bool), ParseFixedError>
fn overflowing_from_str_hex(src: &str) -> Result<(Self, bool), ParseFixedError>
Parses a string slice containing hexadecimal digits to return a fixed-point number.
Returns a tuple of the fixed-point number and a bool
,
indicating whether an overflow has occurred. On overflow, the
wrapped value is returned.
Rounding is to the nearest, with ties rounded to even.
See also
FixedI32::overflowing_from_str_hex
and
FixedU32::overflowing_from_str_hex
.
sourcefn checked_int_log10(self) -> Option<i32>
fn checked_int_log10(self) -> Option<i32>
Checked integer base-10 logarithm, rounded down. Returns the
logarithm or None
if the fixed-point number is ≤ 0.
See also
FixedI32::checked_int_log10
and
FixedU32::checked_int_log10
.
sourcefn checked_int_log(self, base: u32) -> Option<i32>
fn checked_int_log(self, base: u32) -> Option<i32>
Checked integer logarithm to the specified base, rounded down. Returns
the logarithm, or None
if the fixed-point number is ≤ 0 or if
the base is < 2.
See also
FixedI32::checked_int_log
and
FixedU32::checked_int_log
.
sourcefn div_euclid(self, rhs: Self) -> Self
fn div_euclid(self, rhs: Self) -> Self
Euclidean division by an integer.
See also FixedI32::div_euclid
and
FixedU32::div_euclid
.
Panics
Panics if the divisor is zero or if the division results in overflow.
sourcefn div_euclid_int(self, rhs: Self::Bits) -> Self
fn div_euclid_int(self, rhs: Self::Bits) -> Self
Euclidean division by an integer.
See also
FixedI32::div_euclid_int
and
FixedU32::div_euclid_int
.
Panics
Panics if the divisor is zero or if the division results in overflow.
sourcefn rem_euclid_int(self, rhs: Self::Bits) -> Self
fn rem_euclid_int(self, rhs: Self::Bits) -> Self
Remainder for Euclidean division by an integer.
See also
FixedI32::rem_euclid_int
and
FixedU32::rem_euclid_int
.
Panics
Panics if the divisor is zero or if the division results in overflow.
sourcefn overflowing_div(self, rhs: Self) -> (Self, bool)
fn overflowing_div(self, rhs: Self) -> (Self, bool)
Overflowing division.
Returns a tuple of the quotient and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped
value is returned.
See also
FixedI32::overflowing_div
and
FixedU32::overflowing_div
.
Panics
Panics if the divisor is zero.
sourcefn overflowing_recip(self) -> (Self, bool)
fn overflowing_recip(self) -> (Self, bool)
Overflowing reciprocal.
Returns a tuple of the reciprocal of self
and a bool
,
indicating whether an overflow has occurred. On overflow, the
wrapped value is returned.
See also
FixedI32::overflowing_recip
and
FixedU32::overflowing_recip
.
Panics
Panics if self
is zero.
sourcefn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
Overflowing Euclidean division.
Returns a tuple of the quotient and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped
value is returned.
See also
FixedI32::overflowing_div_euclid
and
FixedU32::overflowing_div_euclid
.
Panics
Panics if the divisor is zero.
sourcefn checked_div(self, rhs: Self) -> Option<Self>
fn checked_div(self, rhs: Self) -> Option<Self>
Checked division. Returns the quotient, or None
if the
divisor is zero or on overflow.
See also FixedI32::checked_div
and FixedU32::checked_div
.
sourcefn checked_recip(self) -> Option<Self>
fn checked_recip(self) -> Option<Self>
Checked reciprocal. Returns the reciprocal, or None
if
self
is zero or on overflow.
See also
FixedI32::checked_recip
and
FixedU32::checked_recip
.
sourcefn checked_div_euclid(self, rhs: Self) -> Option<Self>
fn checked_div_euclid(self, rhs: Self) -> Option<Self>
Checked remainder for Euclidean division. Returns the
remainder, or None
if the divisor is zero or the division
results in overflow.
See also
FixedI32::checked_div_euclid
and
FixedU32::checked_div_euclid
.
sourcefn checked_rem_int(self, rhs: Self::Bits) -> Option<Self>
fn checked_rem_int(self, rhs: Self::Bits) -> Option<Self>
Checked fixed-point remainder for division by an integer.
Returns the remainder, or None
if the divisor is zero or
if the division results in overflow.
See also
FixedI32::checked_rem_int
and
FixedU32::checked_rem_int
.
sourcefn checked_div_euclid_int(self, rhs: Self::Bits) -> Option<Self>
fn checked_div_euclid_int(self, rhs: Self::Bits) -> Option<Self>
Checked Euclidean division by an integer. Returns the
quotient, or None
if the divisor is zero or if the
division results in overflow.
See also
FixedI32::checked_div_euclid_int
and
FixedU32::checked_div_euclid_int
.
sourcefn checked_rem_euclid_int(self, rhs: Self::Bits) -> Option<Self>
fn checked_rem_euclid_int(self, rhs: Self::Bits) -> Option<Self>
Checked remainder for Euclidean division by an integer.
Returns the remainder, or None
if the divisor is zero or
if the remainder results in overflow.
See also
FixedI32::checked_rem_euclid_int
and
FixedU32::checked_rem_euclid_int
.
sourcefn checked_lerp(self, start: Self, end: Self) -> Option<Self>
fn checked_lerp(self, start: Self, end: Self) -> Option<Self>
Checked linear interpolation between start
and end
. Returns None
on overflow.
See also FixedI32::checked_lerp
and FixedU32::checked_lerp
.
sourcefn checked_inv_lerp(self, start: Self, end: Self) -> Option<Self>
fn checked_inv_lerp(self, start: Self, end: Self) -> Option<Self>
Checked inverse linear interpolation between start
and end
. Returns
None
when start
= end
or on overflow.
See also
FixedI32::checked_inv_lerp
and
FixedU32::checked_inv_lerp
.
sourcefn saturating_div(self, rhs: Self) -> Self
fn saturating_div(self, rhs: Self) -> Self
Saturating division. Returns the quotient, saturating on overflow.
See also
FixedI32::saturating_div
and
FixedU32::saturating_div
.
Panics
Panics if the divisor is zero.
sourcefn saturating_recip(self) -> Self
fn saturating_recip(self) -> Self
Saturating reciprocal.
See also
FixedI32::saturating_recip
and
FixedU32::saturating_recip
.
Panics
Panics if self
is zero.
sourcefn saturating_div_euclid(self, rhs: Self) -> Self
fn saturating_div_euclid(self, rhs: Self) -> Self
Saturating Euclidean division. Returns the quotient, saturating on overflow.
See also
FixedI32::saturating_div_euclid
and
FixedU32::saturating_div_euclid
.
Panics
Panics if the divisor is zero.
sourcefn saturating_div_euclid_int(self, rhs: Self::Bits) -> Self
fn saturating_div_euclid_int(self, rhs: Self::Bits) -> Self
Saturating Euclidean division by an integer. Returns the quotient, saturating on overflow.
See also
FixedI32::saturating_div_euclid_int
and
FixedU32::saturating_div_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn saturating_rem_euclid_int(self, rhs: Self::Bits) -> Self
fn saturating_rem_euclid_int(self, rhs: Self::Bits) -> Self
Saturating remainder for Euclidean division by an integer. Returns the remainder, saturating on overflow.
See also
FixedI32::saturating_rem_euclid_int
and
FixedU32::saturating_rem_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn saturating_lerp(self, start: Self, end: Self) -> Self
fn saturating_lerp(self, start: Self, end: Self) -> Self
Linear interpolation between start
and end
, saturating on overflow.
See also
FixedI32::saturating_lerp
and
FixedU32::saturating_lerp
.
sourcefn saturating_inv_lerp(self, start: Self, end: Self) -> Self
fn saturating_inv_lerp(self, start: Self, end: Self) -> Self
Inverse linear interpolation between start
and end
, saturating on overflow.
See also
FixedI32::saturating_inv_lerp
and
FixedU32::saturating_inv_lerp
.
sourcefn wrapping_div(self, rhs: Self) -> Self
fn wrapping_div(self, rhs: Self) -> Self
Wrapping division. Returns the quotient, wrapping on overflow.
See also FixedI32::wrapping_div
and FixedU32::wrapping_div
.
Panics
Panics if the divisor is zero.
sourcefn wrapping_recip(self) -> Self
fn wrapping_recip(self) -> Self
Wrapping reciprocal.
See also
FixedI32::wrapping_recip
and
FixedU32::wrapping_recip
.
Panics
Panics if self
is zero.
sourcefn wrapping_div_euclid(self, rhs: Self) -> Self
fn wrapping_div_euclid(self, rhs: Self) -> Self
Wrapping Euclidean division. Returns the quotient, wrapping on overflow.
See also
FixedI32::wrapping_div_euclid
and
FixedU32::wrapping_div_euclid
.
Panics
Panics if the divisor is zero.
sourcefn wrapping_div_euclid_int(self, rhs: Self::Bits) -> Self
fn wrapping_div_euclid_int(self, rhs: Self::Bits) -> Self
Wrapping Euclidean division by an integer. Returns the quotient, wrapping on overflow.
Overflow can only occur when dividing the minimum value by −1.
See also
FixedI32::wrapping_div_euclid_int
and
FixedU32::wrapping_div_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn wrapping_rem_euclid_int(self, rhs: Self::Bits) -> Self
fn wrapping_rem_euclid_int(self, rhs: Self::Bits) -> Self
Wrapping remainder for Euclidean division by an integer. Returns the remainder, wrapping on overflow.
See also
FixedI32::wrapping_rem_euclid_int
and
FixedU32::wrapping_rem_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn wrapping_lerp(self, start: Self, end: Self) -> Self
fn wrapping_lerp(self, start: Self, end: Self) -> Self
Linear interpolation between start
and end
, wrapping on overflow.
See also
FixedI32::wrapping_lerp
and
FixedU32::wrapping_lerp
.
sourcefn wrapping_inv_lerp(self, start: Self, end: Self) -> Self
fn wrapping_inv_lerp(self, start: Self, end: Self) -> Self
Inverse linear interpolation between start
and end
, wrapping on
overflow.
See also
FixedI32::wrapping_inv_lerp
and
FixedU32::wrapping_inv_lerp
.
sourcefn unwrapped_div(self, rhs: Self) -> Self
fn unwrapped_div(self, rhs: Self) -> Self
Unwrapped division. Returns the quotient, panicking on overflow.
See also
FixedI32::unwrapped_div
and
FixedU32::unwrapped_div
.
Panics
Panics if the divisor is zero or if the result does not fit.
sourcefn unwrapped_recip(self) -> Self
fn unwrapped_recip(self) -> Self
Unwrapped reciprocal. Returns reciprocal, panicking on overflow.
See also
FixedI32::unwrapped_recip
and
FixedU32::unwrapped_recip
.
Panics
Panics if self
is zero or on overflow.
sourcefn unwrapped_div_euclid(self, rhs: Self) -> Self
fn unwrapped_div_euclid(self, rhs: Self) -> Self
Unwrapped Euclidean division. Returns the quotient, panicking on overflow.
See also
FixedI32::unwrapped_div_euclid
and
FixedU32::unwrapped_div_euclid
.
Panics
Panics if the divisor is zero or if the result does not fit.
sourcefn unwrapped_rem_int(self, rhs: Self::Bits) -> Self
fn unwrapped_rem_int(self, rhs: Self::Bits) -> Self
Unwrapped remainder for division by an integer. Returns the remainder, panicking if the divisor is zero.
See also
FixedI32::unwrapped_rem_int
and
FixedU32::unwrapped_rem_int
.
Panics
Panics if the divisor is zero.
sourcefn unwrapped_div_euclid_int(self, rhs: Self::Bits) -> Self
fn unwrapped_div_euclid_int(self, rhs: Self::Bits) -> Self
Unwrapped Euclidean division by an integer. Returns the quotient, panicking on overflow.
Overflow can only occur when dividing the minimum value by −1.
See also
FixedI32::unwrapped_div_euclid_int
and
FixedU32::unwrapped_div_euclid_int
.
Panics
Panics if the divisor is zero or if the result does not fit.
sourcefn unwrapped_rem_euclid_int(self, rhs: Self::Bits) -> Self
fn unwrapped_rem_euclid_int(self, rhs: Self::Bits) -> Self
Unwrapped remainder for Euclidean division by an integer. Returns the remainder, panicking on overflow.
See also
FixedI32::unwrapped_rem_euclid_int
and
FixedU32::unwrapped_rem_euclid_int
.
Panics
Panics if the divisor is zero or if the result does not fit.
sourcefn unwrapped_lerp(self, start: Self, end: Self) -> Self
fn unwrapped_lerp(self, start: Self, end: Self) -> Self
Linear interpolation between start
and end
, panicking on overflow.
Panics
Panics if the result does not fit.
See also
FixedI32::unwrapped_lerp
and
FixedU32::unwrapped_lerp
.
sourcefn unwrapped_inv_lerp(self, start: Self, end: Self) -> Self
fn unwrapped_inv_lerp(self, start: Self, end: Self) -> Self
Inverse linear interpolation between start
and end
, panicking on overflow.
Panics
Panics when start
= end
or when the results overflows.
See also
FixedI32::unwrapped_inv_lerp
and
FixedU32::unwrapped_inv_lerp
.
sourcefn overflowing_div_euclid_int(self, rhs: Self::Bits) -> (Self, bool)
fn overflowing_div_euclid_int(self, rhs: Self::Bits) -> (Self, bool)
Overflowing Euclidean division by an integer.
Returns a tuple of the quotient and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped
value is returned.
See also
FixedI32::overflowing_div_euclid_int
and
FixedU32::overflowing_div_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn overflowing_rem_euclid_int(self, rhs: Self::Bits) -> (Self, bool)
fn overflowing_rem_euclid_int(self, rhs: Self::Bits) -> (Self, bool)
Overflowing remainder for Euclidean division by an integer.
Returns a tuple of the remainder and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped
value is returned.
See also
FixedI32::overflowing_rem_euclid_int
and
FixedU32::overflowing_rem_euclid_int
.
Panics
Panics if the divisor is zero.
sourcefn overflowing_lerp(self, start: Self, end: Self) -> (Self, bool)
fn overflowing_lerp(self, start: Self, end: Self) -> (Self, bool)
Overflowing linear interpolation between start
and end
.
Returns a tuple of the interpolated value and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped value is
returned.
See also
FixedI32::overflowing_lerp
and
FixedU32::overflowing_lerp
.
sourcefn overflowing_inv_lerp(self, start: Self, end: Self) -> (Self, bool)
fn overflowing_inv_lerp(self, start: Self, end: Self) -> (Self, bool)
Overflowing inverse linear interpolation between start
and end
.
Returns a tuple of the computed value and a bool
, indicating
whether an overflow has occurred. On overflow, the wrapped value is
returned.
See also
FixedI32::overflowing_inv_lerp
and
FixedU32::overflowing_inv_lerp
.