pub trait FixedStrict: Fixed where
    Self: Display + Binary + Octal + LowerHex + UpperHex,
    Self: FromStr<Err = ParseFixedError>,
    Self: Div<Output = Self> + DivAssign,
    Self: Rem<<Self as Fixed>::Bits, Output = Self> + RemAssign<<Self as Fixed>::Bits>,
    Self: Rem<<Self as Fixed>::NonZeroBits, Output = Self>,
    Self: RemAssign<<Self as Fixed>::NonZeroBits>,
    Self: FixedOptionalFeatures
{
Show 60 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 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 checked_int_log10(self) -> 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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Integer base-10 logarithm, rounded down.

See also FixedI32::int_log10 and FixedU32::int_log10.

Panics

Panics if the fixed-point number is ≤ 0.

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.

Returns the reciprocal.

See also FixedI32::recip and FixedU32::recip.

Panics

Panics if self is zero.

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.

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.

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.

Linear interpolation between start and end.

See also FixedI32::lerp and FixedU32::lerp.

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.

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.

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.

Inverse linear interpolation between start and end.

See also FixedI32::inv_lerp and FixedU32::inv_lerp.

Checked division. Returns the quotient, or None if the divisor is zero or on overflow.

See also FixedI32::checked_div and FixedU32::checked_div.

Checked reciprocal. Returns the reciprocal, or None if self is zero or on overflow.

See also FixedI32::checked_recip and FixedU32::checked_recip.

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.

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.

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.

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.

Checked linear interpolation between start and end. Returns None on overflow.

See also FixedI32::checked_lerp and FixedU32::checked_lerp.

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.

Saturating division. Returns the quotient, saturating on overflow.

See also FixedI32::saturating_div and FixedU32::saturating_div.

Panics

Panics if the divisor is zero.

Saturating reciprocal.

See also FixedI32::saturating_recip and FixedU32::saturating_recip.

Panics

Panics if self is zero.

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.

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.

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.

Linear interpolation between start and end, saturating on overflow.

See also FixedI32::saturating_lerp and FixedU32::saturating_lerp.

Inverse linear interpolation between start and end, saturating on overflow.

See also FixedI32::saturating_inv_lerp and FixedU32::saturating_inv_lerp.

Wrapping division. Returns the quotient, wrapping on overflow.

See also FixedI32::wrapping_div and FixedU32::wrapping_div.

Panics

Panics if the divisor is zero.

Wrapping reciprocal.

See also FixedI32::wrapping_recip and FixedU32::wrapping_recip.

Panics

Panics if self is zero.

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.

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.

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.

Linear interpolation between start and end, wrapping on overflow.

See also FixedI32::wrapping_lerp and FixedU32::wrapping_lerp.

Inverse linear interpolation between start and end, wrapping on overflow.

See also FixedI32::wrapping_inv_lerp and FixedU32::wrapping_inv_lerp.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Implementors