[−][src]Struct hugefloat::Float
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.
fn add(self, other: Self) -> Self::Output
[src]
impl Add<f64> for Float
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: f64) -> Self::Output
[src]
impl Add<i64> for Float
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: i64) -> Self::Output
[src]
impl<T> AddAssign<T> for Float where
Float: Add<T, Output = Float>,
[src]
Float: Add<T, Output = Float>,
fn add_assign(&mut self, other: T)
[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.
fn div(self, other: Self) -> Self::Output
[src]
impl Div<f64> for Float
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: f64) -> Self::Output
[src]
impl Div<i64> for Float
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: i64) -> Self::Output
[src]
impl<T> DivAssign<T> for Float where
Float: Div<T, Output = Float>,
[src]
Float: Div<T, Output = Float>,
fn div_assign(&mut self, other: T)
[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.
fn from_str(input: &str) -> Result<Self, Self::Err>
[src]
impl LowerExp for Float
[src]
impl Mul<Float> for Float
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl Mul<f64> for Float
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> Self::Output
[src]
impl Mul<i64> for Float
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: i64) -> Self::Output
[src]
impl<T> MulAssign<T> for Float where
Float: Mul<T, Output = Float>,
[src]
Float: Mul<T, Output = Float>,
fn mul_assign(&mut self, other: T)
[src]
impl Neg for Float
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl PartialEq<Float> for Float
[src]
impl PartialOrd<Float> for Float
[src]
fn partial_cmp(&self, value: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for Float
[src]
impl Sub<Float> for Float
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Float) -> Self::Output
[src]
impl Sub<f64> for Float
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: f64) -> Self::Output
[src]
impl Sub<i64> for Float
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: i64) -> Self::Output
[src]
impl<T> SubAssign<T> for Float where
Float: Sub<T, Output = Float>,
[src]
Float: Sub<T, Output = Float>,
fn sub_assign(&mut self, other: T)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,