Enum number_general::Float
source · pub enum Float {
F32(f32),
F64(f64),
}
Expand description
A floating-point number.
Variants§
Trait Implementations§
source§impl AddAssign for Float
impl AddAssign for Float
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl DivAssign for Float
impl DivAssign for Float
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moresource§impl FloatInstance for Float
impl FloatInstance for Float
source§fn is_infinite(&self) -> bool
fn is_infinite(&self) -> bool
source§impl GetSize for Float
impl GetSize for Float
source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
source§impl MulAssign for Float
impl MulAssign for Float
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moresource§impl NumberInstance for Float
impl NumberInstance for Float
type Abs = Float
type Exp = Float
type Log = Float
type Round = Int
type Class = FloatType
source§fn class(&self) -> FloatType
fn class(&self) -> FloatType
Get an impl of
NumberClass
describing this number.source§fn into_type(self, dtype: FloatType) -> Float
fn into_type(self, dtype: FloatType) -> Float
Cast this number into the specified
NumberClass
.source§fn log<N: NumberInstance>(self, base: N) -> Self::Log
fn log<N: NumberInstance>(self, base: N) -> Self::Log
Compute the logarithm of this number with respect to the given
base
.source§impl PartialEq for Float
impl PartialEq for Float
source§impl PartialOrd for Float
impl PartialOrd for Float
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 RealInstance for Float
impl RealInstance for Float
source§impl RemAssign for Float
impl RemAssign for Float
source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the
%=
operation. Read moresource§impl SubAssign for Float
impl SubAssign for Float
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy for Float
impl Eq for Float
Auto Trait Implementations§
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<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.