[][src]Struct hugefloat::Float

pub struct Float { /* fields omitted */ }

A number that behaves mostly like a float, but with an extremely large maximum value.

To construct a Float outside the range of f64, use either Float::sci or the FromStr implementation.

assert_eq!("1".parse(), Ok(Float::sci(1.0, 0)));
assert_eq!("1e10000".parse(), Ok(Float::sci(1.0, 10000)));

Implementations

impl Float[src]

pub const MAX: Float[src]

The largest value that Float can represent: 1e9_000_000_000_000_000.

pub const MIN: Float[src]

The smallest value that Float can represent. Equivalent to -MAX.

pub const NAN: Float[src]

pub fn mantissa(self) -> f64[src]

pub fn exponent(self) -> i64[src]

pub fn sci(base: f64, exponent: i64) -> Self[src]

Construct a Float from a base and exponent.

pub fn float(value: f64) -> Self[src]

Convert a regular float to a Float.

pub fn int(value: i64) -> Self[src]

Convert an integer value to a Float.

pub fn try_float(self) -> Option<f64>[src]

Try to convert self to f64. None if self does not fit in f64, i.e. if it's higher than f64::MAX or lower than f64::MIN.

pub fn to_float(self) -> f64[src]

Like try_float, but overflows will be represented as positive or negative infinity.

assert_eq!(Float::sci(1.0, 10).to_float(), 1.0e10);
assert!(Float::sci(1.0, 10000).to_float().is_infinite());

pub fn abs(self) -> Self[src]

pub fn signum(self) -> f64[src]

pub fn recip(self) -> Self[src]

pub fn round(self) -> Self[src]

pub fn floor(self) -> Self[src]

pub fn ceil(self) -> Self[src]

pub fn trunc(self) -> Self[src]

pub fn log10(self) -> f64[src]

pub fn log2(self) -> f64[src]

pub fn ln(self) -> f64[src]

pub fn log(self, base: f64) -> f64[src]

This method panics if base < 2.0.

pub fn powf(self, n: f64) -> Self[src]

pub fn powi(self, n: i32) -> Self[src]

pub fn exp(self) -> Self[src]

pub fn sqrt(self) -> Self[src]

pub fn cbrt(self) -> Self[src]

Trait Implementations

impl Add<Float> for Float[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<f64> for Float[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<i64> for Float[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> AddAssign<T> for Float where
    Float: Add<T, Output = Float>, 
[src]

impl Clone for Float[src]

impl Copy for Float[src]

impl Debug for Float[src]

impl Display for Float[src]

impl Div<Float> for Float[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<f64> for Float[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<i64> for Float[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> DivAssign<T> for Float where
    Float: Div<T, Output = Float>, 
[src]

impl From<f64> for Float[src]

impl From<i64> for Float[src]

impl FromStr for Float[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl LowerExp for Float[src]

impl Mul<Float> for Float[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<f64> for Float[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<i64> for Float[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> MulAssign<T> for Float where
    Float: Mul<T, Output = Float>, 
[src]

impl Neg for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Float> for Float[src]

impl PartialOrd<Float> for Float[src]

impl StructuralPartialEq for Float[src]

impl Sub<Float> for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<f64> for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<i64> for Float[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> SubAssign<T> for Float where
    Float: Sub<T, Output = Float>, 
[src]

impl UpperExp for Float[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.