pub struct Float {
pub val: Float,
}Fields§
§val: FloatImplementations§
Trait Implementations§
Source§impl<'a> AddAssign<&'a Float> for Float
impl<'a> AddAssign<&'a Float> for Float
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read moreSource§impl<B> AddAssign<B> for Float
impl<B> AddAssign<B> for Float
Source§fn add_assign(&mut self, rhs: B)
fn add_assign(&mut self, rhs: B)
Performs the
+= operation. Read moreSource§impl AddAssign for Float
impl AddAssign for Float
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl ArchimedeanDiv for Float
impl ArchimedeanDiv for Float
Source§fn embed_nat<N: Natural>(n: N) -> Self
fn embed_nat<N: Natural>(n: N) -> Self
Maps a natural number into this structure preserving addition and
using the relevant canonical representation Read more
Source§fn div_arch(self, rhs: Self) -> Self
fn div_arch(self, rhs: Self) -> Self
the unique integer
n such that n*rhs <= self and (n+1)*rhs > selfSource§fn rem_arch(self, rhs: Self) -> Self
fn rem_arch(self, rhs: Self) -> Self
the remaining difference after dividing by rhs (ie.
self - self.div_arch(rhs)*rhs)Source§fn div_alg_arch(self, rhs: Self) -> (Self, Self)
fn div_alg_arch(self, rhs: Self) -> (Self, Self)
Source§impl CheckedAdd for Float
impl CheckedAdd for Float
Source§fn checked_add(&self, v: &Self) -> Option<Self>
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl CheckedDiv for Float
impl CheckedDiv for Float
Source§fn checked_div(&self, v: &Self) -> Option<Self>
fn checked_div(&self, v: &Self) -> Option<Self>
Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens,
None is returned.Source§impl CheckedMul for Float
impl CheckedMul for Float
Source§fn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens,
None is returned.Source§impl CheckedNeg for Float
impl CheckedNeg for Float
Source§fn checked_neg(&self) -> Option<Self>
fn checked_neg(&self) -> Option<Self>
Negates a number, returning
None for results that can’t be represented, like signed MIN
values that can’t be positive, or non-zero unsigned values that can’t be negative. Read moreSource§impl CheckedRem for Float
impl CheckedRem for Float
Source§fn checked_rem(&self, v: &Self) -> Option<Self>
fn checked_rem(&self, v: &Self) -> Option<Self>
Finds the remainder of dividing two numbers, checking for underflow, overflow and division
by zero. If any of that happens,
None is returned. Read moreSource§impl CheckedSub for Float
impl CheckedSub for Float
Source§fn checked_sub(&self, v: &Self) -> Option<Self>
fn checked_sub(&self, v: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.Source§impl ComplexSubset for Float
impl ComplexSubset for Float
type Real = Float
type Natural = Integer
type Integer = Integer
Source§fn as_real(self) -> Self::Real
fn as_real(self) -> Self::Real
Converts
self to a real number, discarding any imaginary component, if complex.Source§fn as_natural(self) -> Self::Natural
fn as_natural(self) -> Self::Natural
Converts
self to a natural number, truncating when necessary.Source§fn as_integer(self) -> Self::Integer
fn as_integer(self) -> Self::Integer
Converts
self to an integer, truncating when necessary.Source§fn floor(self) -> Self
fn floor(self) -> Self
Rounds the real and imaginary components of
self to the closest integer downwardSource§fn ceil(self) -> Self
fn ceil(self) -> Self
Rounds the real and imaginary components of
self to the closest integer upwardSource§fn round(self) -> Self
fn round(self) -> Self
Rounds the real and imaginary components of
self to the closest integerSource§fn trunc(self) -> Self
fn trunc(self) -> Self
Rounds the real and imaginary components of
self by removing the factional partsSource§fn fract(self) -> Self
fn fract(self) -> Self
Removes the integral parts of the real and imaginary components of
selfSource§fn modulus_sqrd(self) -> Self
fn modulus_sqrd(self) -> Self
The square of the complex absolute value of
self Read moreSource§impl<'a> DivAssign<&'a Float> for Float
impl<'a> DivAssign<&'a Float> for Float
Source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
Performs the
/= operation. Read moreSource§impl<B> DivAssign<B> for Float
impl<B> DivAssign<B> for Float
Source§fn div_assign(&mut self, rhs: B)
fn div_assign(&mut self, rhs: B)
Performs the
/= operation. Read moreSource§impl DivAssign for Float
impl DivAssign for Float
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl Divisibility for Float
impl Divisibility for Float
Source§impl EuclideanDiv for Float
impl EuclideanDiv for Float
Source§fn euclid_norm(&self) -> Self::Naturals
fn euclid_norm(&self) -> Self::Naturals
A measure of the “degree” of a given element. Read more
Source§fn div_euc(self, rhs: Self) -> Self
fn div_euc(self, rhs: Self) -> Self
The quotient from Euclidean division
Source§fn rem_euc(self, rhs: Self) -> Self
fn rem_euc(self, rhs: Self) -> Self
The remainder from the Euclidean division
Source§impl Exponential for Float
impl Exponential for Float
Source§impl FromPrimitive for Float
impl FromPrimitive for Float
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_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
Converts an
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§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_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
Converts an
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl<'a> MulAssign<&'a Float> for Float
impl<'a> MulAssign<&'a Float> for Float
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
Performs the
*= operation. Read moreSource§impl<B> MulAssign<B> for Float
impl<B> MulAssign<B> for Float
Source§fn mul_assign(&mut self, rhs: B)
fn mul_assign(&mut self, rhs: B)
Performs the
*= operation. Read moreSource§impl MulAssign for Float
impl MulAssign for Float
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl PartialOrd for Float
impl PartialOrd for Float
Source§impl RealExponential for Float
impl RealExponential for Float
Source§fn try_pow(self, power: Self) -> Option<Self>
fn try_pow(self, power: Self) -> Option<Self>
This element raised to the given power as defined by
x^y = exp(ln(x)*y), if ln(x) existsSource§fn try_root(self, index: Self) -> Option<Self>
fn try_root(self, index: Self) -> Option<Self>
This element taken to the given root as defined as
root(x, y) = x^(1/y), if ln(x) and 1/y existfn sqrt(self) -> Self
fn cbrt(self) -> Self
Source§fn e() -> Self
fn e() -> Self
The exponential of 1. Mirrors ::core::f32::consts::E
Source§fn ln_2() -> Self
fn ln_2() -> Self
The natural logarithm of 2. Mirrors ::core::f32::consts::LN_2
Source§fn ln_10() -> Self
fn ln_10() -> Self
The natural logarithm of 10. Mirrors ::core::f32::consts::LN_10
Source§fn log2_e() -> Self
fn log2_e() -> Self
The logarithm base 2 of e. Mirrors ::core::f32::consts::LOG2_E
Source§fn log10_e() -> Self
fn log10_e() -> Self
The logarithm base 10 of e. Mirrors ::core::f32::consts::LOG10_E
Source§fn log2_10() -> Self
fn log2_10() -> Self
The logarithm base 2 of 10. Mirrors ::core::f32::consts::LOG2_10
Source§fn log10_2() -> Self
fn log10_2() -> Self
The logarithm base 10 of 2. Mirrors ::core::f32::consts::LOG10_2
Source§fn sqrt_2() -> Self
fn sqrt_2() -> Self
The square root of 2. Mirrors ::core::f32::consts::SQRT_2
Source§fn frac_1_sqrt_2() -> Self
fn frac_1_sqrt_2() -> Self
One over the square root of 2. Mirrors ::core::f32::consts::FRAC_1_SQRT_2
Source§impl<'a> RemAssign<&'a Float> for Float
impl<'a> RemAssign<&'a Float> for Float
Source§fn rem_assign(&mut self, rhs: &Self)
fn rem_assign(&mut self, rhs: &Self)
Performs the
%= operation. Read moreSource§impl<B> RemAssign<B> for Float
impl<B> RemAssign<B> for Float
Source§fn rem_assign(&mut self, rhs: B)
fn rem_assign(&mut self, rhs: B)
Performs the
%= operation. Read moreSource§impl RemAssign for Float
impl RemAssign for Float
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%= operation. Read moreSource§impl<'a> SubAssign<&'a Float> for Float
impl<'a> SubAssign<&'a Float> for Float
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-= operation. Read moreSource§impl<B> SubAssign<B> for Float
impl<B> SubAssign<B> for Float
Source§fn sub_assign(&mut self, rhs: B)
fn sub_assign(&mut self, rhs: B)
Performs the
-= operation. Read moreSource§impl SubAssign for Float
impl SubAssign for Float
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl ToPrimitive for Float
impl ToPrimitive for Float
Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
Converts the value of
self to an i64. If the value cannot be
represented by an i64, then None is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Converts the value of
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
Converts the value of
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
Converts the value of
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
Converts the value of
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
Converts the value of
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
Converts the value of
self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
Converts the value of
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
Converts the value of
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
Converts the value of
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
Converts the value of
self to a u32. If the value cannot be
represented by a u32, then None is returned.Source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
Converts the value of
self to a u128. If the value cannot be
represented by a u128 (u64 under the default implementation), then
None is returned. Read moreSource§impl Trig for Float
impl Trig for Float
Source§fn atan2(y: Self, x: Self) -> Self
fn atan2(y: Self, x: Self) -> Self
A continuous function of two variables where
tan(atan2(y,x)) = y/x for y!=0 and atan2(0,1) = 0 Read moreSource§fn pythag_const() -> Self
fn pythag_const() -> Self
The length of the hypotenuse of a unit right-triangle. Mirrors SQRT_2
Source§fn pythag_const_inv() -> Self
fn pythag_const_inv() -> Self
The sine of
π/4. Mirrors FRAC_1_SQRT_2fn to_degrees(self) -> Self
fn to_radians(self) -> Self
impl AddAssociative for Float
impl AddCommutative for Float
impl AddOrdered for Float
impl ArchimedeanProperty for Float
impl Distributive for Float
impl MulAssociative for Float
impl MulCommutative for Float
impl MulOrdered for Float
impl NoZeroDivisors for Float
impl StructuralPartialEq for Float
Auto Trait Implementations§
impl Freeze for Float
impl RefUnwindSafe for Float
impl Send for Float
impl Sync for Float
impl Unpin for Float
impl UnwindSafe for Float
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<G> MulN for Gwhere
G: AddSemigroup + Zero,
impl<G> MulN for Gwhere
G: AddSemigroup + Zero,
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<G> PowN for Gwhere
G: MulSemigroup + One,
impl<G> PowN for Gwhere
G: MulSemigroup + One,
Source§impl<G> PowZ for Gwhere
G: MulMonoid + Invertable,
impl<G> PowZ for Gwhere
G: MulMonoid + Invertable,
fn pow_z<Z>(self, n: Z) -> Selfwhere
Z: IntegerSubset,
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<G> Signed for Gwhere
G: PartialOrd + Zero,
impl<G> Signed for Gwhere
G: PartialOrd + Zero,
Source§default fn non_negative(&self) -> bool
default fn non_negative(&self) -> bool
If this element is greater than or equal to zero
Source§default fn non_positive(&self) -> bool
default fn non_positive(&self) -> bool
If this element is less than or equal to zero
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> 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.