[][src]Struct rustc_apfloat::ieee::IeeeFloat

#[must_use]pub struct IeeeFloat<S> {
    sig: [u128; 1],
    exp: ExpInt,
    category: Category,
    sign: bool,
    marker: PhantomData<S>,
}

Fields

sig: [u128; 1]

Absolute significand value (including the integer bit).

exp: ExpInt

The signed unbiased exponent of the value.

category: Category

What kind of floating point number this is.

sign: bool

Sign bit of the number.

marker: PhantomData<S>

Implementations

impl<S: Semantics> IeeeFloat<S>[src]

fn overflow_result(round: Round) -> StatusAnd<Self>[src]

Handle positive overflow. We either return infinity or the largest finite number. For negative overflow, negate the round argument before calling.

fn round_away_from_zero(&self, round: Round, loss: Loss, bit: usize) -> bool[src]

Returns true if, when truncating the current number, with bit the new LSB, with the given lost fraction and rounding mode, the result would need to be rounded away from zero (i.e., by increasing the signficand). This routine must work for Category::Zero of both signs, and Category::Normal numbers.

fn normalize(self, round: Round, loss: Loss) -> StatusAnd<Self>[src]

fn from_hexadecimal_string(
    s: &str,
    round: Round
) -> Result<StatusAnd<Self>, ParseError>
[src]

fn from_decimal_string(
    s: &str,
    round: Round
) -> Result<StatusAnd<Self>, ParseError>
[src]

Trait Implementations

impl<S> Add<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

type Output = StatusAnd<Self>

The resulting type after applying the + operator.

impl<S> AddAssign<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

impl<S> Clone for IeeeFloat<S>[src]

impl<S> Copy for IeeeFloat<S>[src]

impl<S: Semantics> Debug for IeeeFloat<S>[src]

impl<S> Default for IeeeFloat<S> where
    Self: Float
[src]

impl<S: Semantics> Display for IeeeFloat<S>[src]

Prints this value as a decimal string.

\param precision The maximum number of digits of precision to output. If there are fewer digits available, zero padding will not be used unless the value is integral and small enough to be expressed in precision digits. 0 means to use the natural precision of the number. \param width The maximum number of zeros to consider inserting before falling back to scientific notation. 0 means to always use scientific notation.

\param alternate Indicate whether to remove the trailing zero in fraction part or not. Also setting this parameter to true forces producing of output more similar to default printf behavior. Specifically the lower e is used as exponent delimiter and exponent always contains no less than two digits.

Number precision width Result


1.01E+4 5 2 10100 1.01E+4 4 2 1.01E+4 1.01E+4 5 1 1.01E+4 1.01E-2 5 2 0.0101 1.01E-2 4 2 0.0101 1.01E-2 4 1 1.01E-2

impl<S> Div<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

type Output = StatusAnd<Self>

The resulting type after applying the / operator.

impl<S> DivAssign<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

impl<S: Semantics> Float for IeeeFloat<S>[src]

impl<S: Semantics, T: Semantics> FloatConvert<IeeeFloat<T>> for IeeeFloat<S>[src]

impl<F: FloatConvert<Self>> From<DoubleFloat<F>> for IeeeFloat<FallbackS<F>>[src]

impl<F: Float> From<IeeeFloat<FallbackS<F>>> for DoubleFloat<F> where
    F: FloatConvert<IeeeFloat<FallbackExtendedS<F>>>,
    IeeeFloat<FallbackExtendedS<F>>: FloatConvert<F>, 
[src]

impl<S> FromStr for IeeeFloat<S> where
    Self: Float
[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl<S> Mul<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

type Output = StatusAnd<Self>

The resulting type after applying the * operator.

impl<S> MulAssign<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

impl<S> Neg for IeeeFloat<S>[src]

type Output = Self

The resulting type after applying the - operator.

impl<S: Semantics> PartialEq<IeeeFloat<S>> for IeeeFloat<S>[src]

impl<S: Semantics> PartialOrd<IeeeFloat<S>> for IeeeFloat<S>[src]

impl<S> Rem<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

type Output = StatusAnd<Self>

The resulting type after applying the % operator.

impl<S> RemAssign<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

impl<S> Sub<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

type Output = StatusAnd<Self>

The resulting type after applying the - operator.

impl<S> SubAssign<IeeeFloat<S>> for IeeeFloat<S> where
    Self: Float
[src]

Auto Trait Implementations

impl<S> Send for IeeeFloat<S> where
    S: Send

impl<S> Sync for IeeeFloat<S> where
    S: Sync

impl<S> Unpin for IeeeFloat<S> where
    S: Unpin

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.