[−][src]Struct rustc_apfloat::ieee::IeeeFloat
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(mut self: Self, round: Round, mut loss: Loss) -> StatusAnd<Self>
[src]
fn from_hexadecimal_string(
s: &str,
round: Round
) -> Result<StatusAnd<Self>, ParseError>
[src]
s: &str,
round: Round
) -> Result<StatusAnd<Self>, ParseError>
fn from_decimal_string(
s: &str,
round: Round
) -> Result<StatusAnd<Self>, ParseError>
[src]
s: &str,
round: Round
) -> Result<StatusAnd<Self>, ParseError>
Trait Implementations
impl<S> Add<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> StatusAnd<Self>
[src]
impl<S> AddAssign<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
pub fn add_assign(&mut self, rhs: Self)
[src]
impl<S> Clone for IeeeFloat<S>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
Self: Float,
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]
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Self) -> StatusAnd<Self>
[src]
impl<S> DivAssign<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
pub fn div_assign(&mut self, rhs: Self)
[src]
impl<S: Semantics> Float for IeeeFloat<S>
[src]
pub const BITS: usize
[src]
pub const PRECISION: usize
[src]
pub const MAX_EXP: ExpInt
[src]
pub const MIN_EXP: ExpInt
[src]
pub const ZERO: Self
[src]
pub const INFINITY: Self
[src]
pub const NAN: Self
[src]
pub fn qnan(payload: Option<u128>) -> Self
[src]
pub fn snan(payload: Option<u128>) -> Self
[src]
pub fn largest() -> Self
[src]
pub const SMALLEST: Self
[src]
pub fn smallest_normalized() -> Self
[src]
pub fn add_r(mut self: Self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
pub fn mul_r(mut self: Self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
pub fn mul_add_r(
mut self: Self,
multiplicand: Self,
addend: Self,
round: Round
) -> StatusAnd<Self>
[src]
mut self: Self,
multiplicand: Self,
addend: Self,
round: Round
) -> StatusAnd<Self>
pub fn div_r(mut self: Self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
pub fn c_fmod(mut self: Self, rhs: Self) -> StatusAnd<Self>
[src]
pub fn round_to_integral(self, round: Round) -> StatusAnd<Self>
[src]
pub fn next_up(mut self: Self) -> StatusAnd<Self>
[src]
pub fn from_bits(input: u128) -> Self
[src]
pub fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self>
[src]
pub fn from_str_r(
mut s: &str,
mut round: Round
) -> Result<StatusAnd<Self>, ParseError>
[src]
mut s: &str,
mut round: Round
) -> Result<StatusAnd<Self>, ParseError>
pub fn to_bits(self) -> u128
[src]
pub fn to_u128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<u128>
[src]
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<u128>
pub fn cmp_abs_normal(self, rhs: Self) -> Ordering
[src]
pub fn bitwise_eq(self, rhs: Self) -> bool
[src]
pub fn is_negative(self) -> bool
[src]
pub fn is_denormal(self) -> bool
[src]
pub fn is_signaling(self) -> bool
[src]
pub fn category(self) -> Category
[src]
pub fn get_exact_inverse(self) -> Option<Self>
[src]
pub fn ilogb(mut self: Self) -> ExpInt
[src]
pub fn scalbn_r(mut self: Self, exp: ExpInt, round: Round) -> Self
[src]
pub fn frexp_r(mut self: Self, exp: &mut ExpInt, round: Round) -> Self
[src]
pub fn sub_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
pub fn mul_add(self, multiplicand: Self, addend: Self) -> StatusAnd<Self>
[src]
pub fn ieee_rem(self, rhs: Self) -> StatusAnd<Self>
[src]
pub fn next_down(self) -> StatusAnd<Self>
[src]
pub fn abs(self) -> Self
[src]
pub fn copy_sign(self, rhs: Self) -> Self
[src]
pub fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self>
[src]
pub fn from_i128(input: i128) -> StatusAnd<Self>
[src]
pub fn from_u128(input: u128) -> StatusAnd<Self>
[src]
pub fn to_i128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<i128>
[src]
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<i128>
pub fn to_i128(self, width: usize) -> StatusAnd<i128>
[src]
pub fn to_u128(self, width: usize) -> StatusAnd<u128>
[src]
pub fn min(self, other: Self) -> Self
[src]
pub fn max(self, other: Self) -> Self
[src]
pub fn is_normal(self) -> bool
[src]
pub fn is_finite(self) -> bool
[src]
pub fn is_zero(self) -> bool
[src]
pub fn is_infinite(self) -> bool
[src]
pub fn is_nan(self) -> bool
[src]
pub fn is_non_zero(self) -> bool
[src]
pub fn is_finite_non_zero(self) -> bool
[src]
pub fn is_pos_zero(self) -> bool
[src]
pub fn is_neg_zero(self) -> bool
[src]
pub fn is_smallest(self) -> bool
[src]
pub fn is_largest(self) -> bool
[src]
pub fn is_integer(self) -> bool
[src]
pub fn scalbn(self, exp: ExpInt) -> Self
[src]
pub fn frexp(self, exp: &mut ExpInt) -> Self
[src]
impl<S: Semantics, T: Semantics> FloatConvert<IeeeFloat<T>> for IeeeFloat<S>
[src]
pub fn convert_r(
self,
round: Round,
loses_info: &mut bool
) -> StatusAnd<IeeeFloat<T>>
[src]
self,
round: Round,
loses_info: &mut bool
) -> StatusAnd<IeeeFloat<T>>
pub fn convert(self, loses_info: &mut bool) -> StatusAnd<T>
[src]
impl<F: FloatConvert<Self>> From<DoubleFloat<F>> for IeeeFloat<FallbackS<F>>
[src]
pub fn from(DoubleFloat(a, b): DoubleFloat<F>) -> Self
[src]
impl<F: Float> From<IeeeFloat<FallbackS<F>>> for DoubleFloat<F> where
F: FloatConvert<IeeeFloat<FallbackExtendedS<F>>>,
IeeeFloat<FallbackExtendedS<F>>: FloatConvert<F>,
[src]
F: FloatConvert<IeeeFloat<FallbackExtendedS<F>>>,
IeeeFloat<FallbackExtendedS<F>>: FloatConvert<F>,
impl<S> FromStr for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
type Err = ParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Self, ParseError>
[src]
impl<S> Mul<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Self) -> StatusAnd<Self>
[src]
impl<S> MulAssign<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
pub fn mul_assign(&mut self, rhs: Self)
[src]
impl<S> Neg for IeeeFloat<S>
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn neg(mut self: Self) -> Self
[src]
impl<S: Semantics> PartialEq<IeeeFloat<S>> for IeeeFloat<S>
[src]
impl<S: Semantics> PartialOrd<IeeeFloat<S>> for IeeeFloat<S>
[src]
pub fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<S> Rem<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the %
operator.
pub fn rem(self, rhs: Self) -> StatusAnd<Self>
[src]
impl<S> RemAssign<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
pub fn rem_assign(&mut self, rhs: Self)
[src]
impl<S> Sub<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Self) -> StatusAnd<Self>
[src]
impl<S> SubAssign<IeeeFloat<S>> for IeeeFloat<S> where
Self: Float,
[src]
Self: Float,
pub fn sub_assign(&mut self, rhs: Self)
[src]
Auto Trait Implementations
impl<S> Send for IeeeFloat<S> where
S: Send,
[src]
S: Send,
impl<S> Sync for IeeeFloat<S> where
S: Sync,
[src]
S: Sync,
impl<S> Unpin for IeeeFloat<S> where
S: Unpin,
[src]
S: Unpin,
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,