#[repr(transparent)]pub struct FixedI64<Fract>(pub FixedI64<Fract>);
Expand description
Signed fixed-point number with a generic number of bits for the fractional part.
Tuple Fields§
§0: FixedI64<Fract>
Implementations§
Trait Implementations§
source§impl<Fract: LeEqU64> AbsDiffEq<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> AbsDiffEq<FixedI64<Fract>> for FixedI64<Fract>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq
.source§impl<Fract: LeEqU64> AddAssign<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> AddAssign<FixedI64<Fract>> for FixedI64<Fract>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<Fract> ComplexField for FixedI64<Fract>where
Fract: Unsigned + LeEqU64 + IsLessOrEqual<U63, Output = True> + IsLessOrEqual<U62, Output = True> + IsLessOrEqual<U61, Output = True> + IsLessOrEqual<U60, Output = True> + Send + Sync + 'static,
impl<Fract> ComplexField for FixedI64<Fract>where Fract: Unsigned + LeEqU64 + IsLessOrEqual<U63, Output = True> + IsLessOrEqual<U62, Output = True> + IsLessOrEqual<U61, Output = True> + IsLessOrEqual<U60, Output = True> + Send + Sync + 'static,
type RealField = FixedI64<Fract>
source§fn from_real(re: Self::RealField) -> Self
fn from_real(re: Self::RealField) -> Self
Builds a pure-real complex number from the given value.
source§fn norm1(self) -> Self::RealField
fn norm1(self) -> Self::RealField
The sum of the absolute value of this complex number’s real and imaginary part.
source§fn modulus_squared(self) -> Self::RealField
fn modulus_squared(self) -> Self::RealField
The squared modulus of this complex number.
source§fn to_exp(self) -> (Self, Self)
fn to_exp(self) -> (Self, Self)
The exponential form of this complex number: (modulus, e^{i arg})
fn recip(self) -> Self
fn conjugate(self) -> Self
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
source§fn abs(self) -> Self
fn abs(self) -> Self
The absolute value of this complex number:
self / self.signum()
. Read morefn mul_add(self, a: Self, b: Self) -> Self
fn powi(self, _n: i32) -> Self
fn powf(self, _n: Self) -> Self
fn powc(self, _n: Self) -> Self
fn sqrt(self) -> Self
fn try_sqrt(self) -> Option<Self>
fn exp(self) -> Self
fn exp2(self) -> Self
fn exp_m1(self) -> Self
fn ln_1p(self) -> Self
fn ln(self) -> Self
fn log(self, _base: Self) -> Self
fn log2(self) -> Self
fn log10(self) -> Self
fn cbrt(self) -> Self
source§fn hypot(self, _other: Self) -> Self::RealField
fn hypot(self, _other: Self) -> Self::RealField
Computes (self.conjugate() * self + other.conjugate() * other).sqrt()
fn sin(self) -> Self
fn cos(self) -> Self
fn tan(self) -> Self
fn asin(self) -> Self
fn acos(self) -> Self
fn atan(self) -> Self
fn sin_cos(self) -> (Self, Self)
fn sinh(self) -> Self
fn cosh(self) -> Self
fn tanh(self) -> Self
fn asinh(self) -> Self
fn acosh(self) -> Self
fn atanh(self) -> Self
fn is_finite(&self) -> bool
source§fn to_polar(self) -> (Self::RealField, Self::RealField)
fn to_polar(self) -> (Self::RealField, Self::RealField)
The polar form of this complex number: (modulus, arg)
fn sinh_cosh(self) -> (Self, Self)
fn sinhc(self) -> Self
fn coshc(self) -> Self
source§impl<'de, Fract: LeEqU64> Deserialize<'de> for FixedI64<Fract>
impl<'de, Fract: LeEqU64> Deserialize<'de> for FixedI64<Fract>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<Fract: LeEqU64> Distribution<FixedI64<Fract>> for OpenClosed01
impl<Fract: LeEqU64> Distribution<FixedI64<Fract>> for OpenClosed01
source§fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> FixedI64<Fract>
fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> FixedI64<Fract>
Generate a random value of
T
, using rng
as the source of randomness.source§impl<Fract: LeEqU64> Distribution<FixedI64<Fract>> for Standard
impl<Fract: LeEqU64> Distribution<FixedI64<Fract>> for Standard
source§fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> FixedI64<Fract>
fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> FixedI64<Fract>
Generate a random value of
T
, using rng
as the source of randomness.source§impl<Fract: LeEqU64> DivAssign<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> DivAssign<FixedI64<Fract>> for FixedI64<Fract>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<Fract: LeEqU64> DivAssign<i64> for FixedI64<Fract>
impl<Fract: LeEqU64> DivAssign<i64> for FixedI64<Fract>
source§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
Performs the
/=
operation. Read moresource§impl<Fract: LeEqU64> FromPrimitive for FixedI64<Fract>
impl<Fract: LeEqU64> FromPrimitive for FixedI64<Fract>
source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
Converts an
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
Converts an
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
Converts an
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
Converts an
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
Converts an
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
Converts an
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
Converts a
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
Converts an
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
Converts an
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
Converts an
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_f32(n: f32) -> Option<Self>
fn from_f32(n: f32) -> Option<Self>
Converts a
f32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.source§fn from_f64(n: f64) -> Option<Self>
fn from_f64(n: f64) -> Option<Self>
Converts a
f64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moresource§impl<Fract: LeEqU64> MulAssign<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> MulAssign<FixedI64<Fract>> for FixedI64<Fract>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<Fract: LeEqU64> MulAssign<i64> for FixedI64<Fract>
impl<Fract: LeEqU64> MulAssign<i64> for FixedI64<Fract>
source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
Performs the
*=
operation. Read moresource§impl<Fract: LeEqU64> Num for FixedI64<Fract>
impl<Fract: LeEqU64> Num for FixedI64<Fract>
type FromStrRadixErr = ()
source§fn from_str_radix(
_str: &str,
_radix: u32
) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix( _str: &str, _radix: u32 ) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36
). Read moresource§impl<Fract: LeEqU64> Ord for FixedI64<Fract>
impl<Fract: LeEqU64> Ord for FixedI64<Fract>
source§impl<Fract: LeEqU64> PartialEq<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> PartialEq<FixedI64<Fract>> for FixedI64<Fract>
source§impl<Fract: LeEqU64> PartialOrd<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> PartialOrd<FixedI64<Fract>> for FixedI64<Fract>
1.0.0 · source§fn 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 moresource§impl<Fract> RealField for FixedI64<Fract>where
Fract: Unsigned + LeEqU64 + IsLessOrEqual<U63, Output = True> + IsLessOrEqual<U62, Output = True> + IsLessOrEqual<U61, Output = True> + IsLessOrEqual<U60, Output = True> + Send + Sync + 'static,
impl<Fract> RealField for FixedI64<Fract>where Fract: Unsigned + LeEqU64 + IsLessOrEqual<U63, Output = True> + IsLessOrEqual<U62, Output = True> + IsLessOrEqual<U61, Output = True> + IsLessOrEqual<U60, Output = True> + Send + Sync + 'static,
source§fn frac_2_sqrt_pi() -> Self
fn frac_2_sqrt_pi() -> Self
2.0 / sqrt(pi).
source§fn is_sign_positive(&self) -> bool
fn is_sign_positive(&self) -> bool
Is the sign of this real number positive?
source§fn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Is the sign of this real number negative?
fn max(self, other: Self) -> Self
fn min(self, other: Self) -> Self
fn clamp(self, min: Self, max: Self) -> Self
fn atan2(self, other: Self) -> Self
source§impl<Fract: LeEqU64> RelativeEq<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> RelativeEq<FixedI64<Fract>> for FixedI64<Fract>
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
The inverse of
RelativeEq::relative_eq
.source§impl<Fract: LeEqU64> RemAssign<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> RemAssign<FixedI64<Fract>> for FixedI64<Fract>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<Fract: LeEqU64> RemAssign<i64> for FixedI64<Fract>
impl<Fract: LeEqU64> RemAssign<i64> for FixedI64<Fract>
source§fn rem_assign(&mut self, rhs: i64)
fn rem_assign(&mut self, rhs: i64)
Performs the
%=
operation. Read moresource§impl<Fract: LeEqU64> Signed for FixedI64<Fract>
impl<Fract: LeEqU64> Signed for FixedI64<Fract>
source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
source§impl<Fract: LeEqU64> SimdValue for FixedI64<Fract>
impl<Fract: LeEqU64> SimdValue for FixedI64<Fract>
source§unsafe fn extract_unchecked(&self, _: usize) -> Self::Element
unsafe fn extract_unchecked(&self, _: usize) -> Self::Element
Extracts the i-th lane of
self
without bound-checking.source§unsafe fn replace_unchecked(&mut self, _: usize, val: Self::Element)
unsafe fn replace_unchecked(&mut self, _: usize, val: Self::Element)
Replaces the i-th lane of
self
by val
without bound-checking.source§impl<Fract: LeEqU64> SubAssign<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> SubAssign<FixedI64<Fract>> for FixedI64<Fract>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<Fract: LeEqU64> SubsetOf<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> SubsetOf<FixedI64<Fract>> for FixedI64<Fract>
source§fn to_superset(&self) -> FixedI64<Fract>
fn to_superset(&self) -> FixedI64<Fract>
The inclusion map: converts
self
to the equivalent element of its superset.source§fn from_superset(element: &FixedI64<Fract>) -> Option<Self>
fn from_superset(element: &FixedI64<Fract>) -> Option<Self>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn from_superset_unchecked(element: &FixedI64<Fract>) -> Self
fn from_superset_unchecked(element: &FixedI64<Fract>) -> Self
Use with care! Same as
self.to_superset
but without any property checks. Always succeeds.source§fn is_in_subset(_: &FixedI64<Fract>) -> bool
fn is_in_subset(_: &FixedI64<Fract>) -> bool
Checks if
element
is actually part of the subset Self
(and can be converted to it).source§impl<Fract: LeEqU64> SubsetOf<FixedI64<Fract>> for f64
impl<Fract: LeEqU64> SubsetOf<FixedI64<Fract>> for f64
source§fn to_superset(&self) -> FixedI64<Fract>
fn to_superset(&self) -> FixedI64<Fract>
The inclusion map: converts
self
to the equivalent element of its superset.source§fn from_superset(element: &FixedI64<Fract>) -> Option<Self>
fn from_superset(element: &FixedI64<Fract>) -> Option<Self>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn from_superset_unchecked(element: &FixedI64<Fract>) -> Self
fn from_superset_unchecked(element: &FixedI64<Fract>) -> Self
Use with care! Same as
self.to_superset
but without any property checks. Always succeeds.source§fn is_in_subset(_: &FixedI64<Fract>) -> bool
fn is_in_subset(_: &FixedI64<Fract>) -> bool
Checks if
element
is actually part of the subset Self
(and can be converted to it).source§impl<Fract: LeEqU64> UlpsEq<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: LeEqU64> UlpsEq<FixedI64<Fract>> for FixedI64<Fract>
impl<Fract: Copy> Copy for FixedI64<Fract>
impl<Fract: LeEqU64> Eq for FixedI64<Fract>
impl<Fract: LeEqU64> Field for FixedI64<Fract>
impl<Fract: LeEqU64> PrimitiveSimdValue for FixedI64<Fract>
Auto Trait Implementations§
impl<Fract> RefUnwindSafe for FixedI64<Fract>where Fract: RefUnwindSafe,
impl<Fract> Send for FixedI64<Fract>where Fract: Send,
impl<Fract> Sync for FixedI64<Fract>where Fract: Sync,
impl<Fract> Unpin for FixedI64<Fract>where Fract: Unpin,
impl<Fract> UnwindSafe for FixedI64<Fract>where Fract: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere T: Bounded,
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UpperBounded for Twhere
T: Bounded,
impl<T> UpperBounded for Twhere T: Bounded,
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.