pub enum Float {
    F32(f32),
    F64(f64),
}
Expand description

A floating-point number.

Variants§

§

F32(f32)

§

F64(f64)

Trait Implementations§

source§

impl Add for Float

§

type Output = Float

The resulting type after applying the + operator.
source§

fn add(self, other: Float) -> Self

Performs the + operation. Read more
source§

impl AddAssign for Float

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl CastFrom<Complex> for Float

source§

fn cast_from(c: Complex) -> Float

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Float> for Boolean

source§

fn cast_from(f: Float) -> Boolean

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Float> for Int

source§

fn cast_from(f: Float) -> Int

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Float> for UInt

source§

fn cast_from(f: Float) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Float> for f32

source§

fn cast_from(f: Float) -> f32

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Number> for Float

source§

fn cast_from(number: Number) -> Float

Cast an instance of T into an instance of Self.
source§

impl Clone for Float

source§

fn clone(&self) -> Float

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Float

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Float

source§

fn default() -> Float

Returns the “default value” for a type. Read more
source§

impl Display for Float

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div for Float

§

type Output = Float

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign for Float

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl FloatInstance for Float

source§

fn is_infinite(&self) -> bool

Return true if this Number is infinite (e.g. f32::INFINITY).
source§

fn is_nan(&self) -> bool

Return true if this is not a valid number (NaN).
source§

impl From<Boolean> for Float

source§

fn from(b: Boolean) -> Self

Converts to this type from the input type.
source§

impl From<Float> for Complex

source§

fn from(f: Float) -> Self

Converts to this type from the input type.
source§

impl From<Float> for Number

source§

fn from(f: Float) -> Number

Converts to this type from the input type.
source§

impl From<Float> for f64

source§

fn from(f: Float) -> f64

Converts to this type from the input type.
source§

impl From<Int> for Float

source§

fn from(i: Int) -> Self

Converts to this type from the input type.
source§

impl From<UInt> for Float

source§

fn from(u: UInt) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Float

source§

fn from(f: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Float

source§

fn from(f: f64) -> Self

Converts to this type from the input type.
source§

impl FromStr for Float

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl GetSize for Float

source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
source§

impl Hash for Float

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul for Float

§

type Output = Float

The resulting type after applying the * operator.
source§

fn mul(self, other: Float) -> Self

Performs the * operation. Read more
source§

impl MulAssign for Float

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl NumberInstance for Float

§

type Abs = Float

§

type Exp = Float

§

type Log = Float

§

type Round = Int

§

type Class = FloatType

source§

fn class(&self) -> FloatType

Get an impl of NumberClass describing this number.
source§

fn into_type(self, dtype: FloatType) -> Float

Cast this number into the specified NumberClass.
source§

fn abs(self) -> Float

Calculate the absolute value of this number.
source§

fn exp(self) -> Self::Exp

Raise e to the power of this number.
source§

fn ln(self) -> Self::Log

Compute the natural logarithm of this number.
source§

fn log<N: NumberInstance>(self, base: N) -> Self::Log
where Float: From<N>,

Compute the logarithm of this number with respect to the given base.
source§

fn pow(self, exp: Number) -> Self

Raise this number to the given exponent. Read more
source§

fn round(self) -> Self::Round

Return this number rounded to the nearest integer.
source§

fn and(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if self and other are nonzero.
source§

fn not(self) -> Self
where Boolean: CastFrom<Self>,

Return true if this number is zero.
source§

fn or(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if self or other is nonzero.
source§

fn xor(self, other: Self) -> Self
where Boolean: CastFrom<Self>,

Return true if exactly one of self and other is zero.
source§

impl PartialEq for Float

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Float

source§

fn partial_cmp(&self, other: &Float) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Product for Float

source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl RealInstance for Float

source§

const ONE: Self = _

source§

const ZERO: Self = _

source§

fn is_positive(&self) -> bool

Return true if this is zero or a positive number.
source§

fn is_negative(&self) -> bool

Return true if this is a negative number.
source§

fn is_zero(&self) -> bool

Return true if this is zero.
source§

impl Rem for Float

§

type Output = Float

The resulting type after applying the % operator.
source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign for Float

source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
source§

impl Sub for Float

§

type Output = Float

The resulting type after applying the - operator.
source§

fn sub(self, other: Float) -> Self

Performs the - operation. Read more
source§

impl SubAssign for Float

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl Sum for Float

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Trigonometry for Float

§

type Out = Float

source§

fn asin(self) -> Self

Arcsine
source§

fn sin(self) -> Self

Sine
source§

fn sinh(self) -> Self

Hyperbolic sine
source§

fn asinh(self) -> Self

Hyperbolic arcsine
source§

fn acos(self) -> Self

Hyperbolic arccosine
source§

fn cos(self) -> Self

Cosine
source§

fn cosh(self) -> Self

Hyperbolic cosine
source§

fn acosh(self) -> Self

Hyperbolic arccosine
source§

fn atan(self) -> Self

Arctangent
source§

fn tan(self) -> Self

Tangent
source§

fn tanh(self) -> Self

Hyperbolic tangent
source§

fn atanh(self) -> Self

Hyperbolic arctangent
source§

impl Copy for Float

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, T> CastFrom<F> for T
where T: From<F>,

source§

fn cast_from(f: F) -> T

Cast an instance of T into an instance of Self.
source§

impl<T, F> CastInto<F> for T
where F: CastFrom<T>,

source§

fn cast_into(self) -> F

Cast an instance of Self into an instance of T.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F> Match for F

source§

fn matches<T>(&self) -> bool
where T: TryCastFrom<Self>,

Returns true if self can be cast into the target type T.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<F, T> TryCastFrom<F> for T
where T: CastFrom<F>,

source§

fn can_cast_from(_: &F) -> bool

Test if value can be cast into Self.
source§

fn opt_cast_from(f: F) -> Option<T>

Returns Some(Self) if the source value can be cast into Self, otherwise None.
source§

fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>
where OnErr: FnOnce(&T) -> Err,

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.
source§

impl<F, T> TryCastInto<T> for F
where T: TryCastFrom<F>,

source§

fn can_cast_into(&self) -> bool

Test if self can be cast into T.
source§

fn opt_cast_into(self) -> Option<T>

Returns Some(T) if self can be cast into T, otherwise None.
source§

fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>
where OnErr: FnOnce(&Self) -> Err,

Returns Ok(T) if self can be cast into T, otherwise calls on_err.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,