Struct rustc_apfloat::ieee::IeeeFloat [−][src]
#[must_use]pub struct IeeeFloat<S> { /* fields omitted */ }
Trait Implementations
impl<S> Copy for IeeeFloat<S>
[src]
impl<S> Copy for IeeeFloat<S>
impl<S> Clone for IeeeFloat<S>
[src]
impl<S> Clone for IeeeFloat<S>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S> Default for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Default for IeeeFloat<S> where
Self: Float,
impl<S> FromStr for IeeeFloat<S> where
Self: Float,
[src]
impl<S> FromStr for IeeeFloat<S> where
Self: Float,
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, ParseError>
[src]
fn from_str(s: &str) -> Result<Self, ParseError>
Parses a string s
to return a value of this type. Read more
impl<S> Add for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Add for IeeeFloat<S> where
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> StatusAnd<Self>
[src]
fn add(self, rhs: Self) -> StatusAnd<Self>
Performs the +
operation.
impl<S> Sub for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Sub for IeeeFloat<S> where
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> StatusAnd<Self>
[src]
fn sub(self, rhs: Self) -> StatusAnd<Self>
Performs the -
operation.
impl<S> Mul for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Mul for IeeeFloat<S> where
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> StatusAnd<Self>
[src]
fn mul(self, rhs: Self) -> StatusAnd<Self>
Performs the *
operation.
impl<S> Div for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Div for IeeeFloat<S> where
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> StatusAnd<Self>
[src]
fn div(self, rhs: Self) -> StatusAnd<Self>
Performs the /
operation.
impl<S> Rem for IeeeFloat<S> where
Self: Float,
[src]
impl<S> Rem for IeeeFloat<S> where
Self: Float,
type Output = StatusAnd<Self>
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> StatusAnd<Self>
[src]
fn rem(self, rhs: Self) -> StatusAnd<Self>
Performs the %
operation.
impl<S> AddAssign for IeeeFloat<S> where
Self: Float,
[src]
impl<S> AddAssign for IeeeFloat<S> where
Self: Float,
fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation.
impl<S> SubAssign for IeeeFloat<S> where
Self: Float,
[src]
impl<S> SubAssign for IeeeFloat<S> where
Self: Float,
fn sub_assign(&mut self, rhs: Self)
[src]
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation.
impl<S> MulAssign for IeeeFloat<S> where
Self: Float,
[src]
impl<S> MulAssign for IeeeFloat<S> where
Self: Float,
fn mul_assign(&mut self, rhs: Self)
[src]
fn mul_assign(&mut self, rhs: Self)
Performs the *=
operation.
impl<S> DivAssign for IeeeFloat<S> where
Self: Float,
[src]
impl<S> DivAssign for IeeeFloat<S> where
Self: Float,
fn div_assign(&mut self, rhs: Self)
[src]
fn div_assign(&mut self, rhs: Self)
Performs the /=
operation.
impl<S> RemAssign for IeeeFloat<S> where
Self: Float,
[src]
impl<S> RemAssign for IeeeFloat<S> where
Self: Float,
fn rem_assign(&mut self, rhs: Self)
[src]
fn rem_assign(&mut self, rhs: Self)
Performs the %=
operation.
impl<S: Semantics> PartialEq for IeeeFloat<S>
[src]
impl<S: Semantics> PartialEq for IeeeFloat<S>
fn eq(&self, rhs: &Self) -> bool
[src]
fn eq(&self, rhs: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<S: Semantics> PartialOrd for IeeeFloat<S>
[src]
impl<S: Semantics> PartialOrd for IeeeFloat<S>
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
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
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
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
impl<S> Neg for IeeeFloat<S>
[src]
impl<S> Neg for IeeeFloat<S>
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self
[src]
fn neg(self) -> Self
Performs the unary -
operation.
impl<S: Semantics> Display for IeeeFloat<S>
[src]
impl<S: Semantics> Display for IeeeFloat<S>
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
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: Semantics> Debug for IeeeFloat<S>
[src]
impl<S: Semantics> Debug for IeeeFloat<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: Semantics> Float for IeeeFloat<S>
[src]
impl<S: Semantics> Float for IeeeFloat<S>
const BITS: usize
BITS: usize = <S>::BITS
Total number of bits in the in-memory format.
const PRECISION: usize
PRECISION: usize = <S>::PRECISION
Number of bits in the significand. This includes the integer bit.
const MAX_EXP: ExpInt
MAX_EXP: ExpInt = <S>::MAX_EXP
The largest E such that 2E is representable; this matches the definition of IEEE 754. Read more
const MIN_EXP: ExpInt
MIN_EXP: ExpInt = <S>::MIN_EXP
The smallest E such that 2E is a normalized number; this matches the definition of IEEE 754. Read more
const ZERO: Self
ZERO: Self = IeeeFloat{sig: [0], exp: <S>::MIN_EXP - 1, category: Category::Zero, sign: false, marker: PhantomData,}
Positive Zero.
const INFINITY: Self
INFINITY: Self = IeeeFloat{sig: [0], exp: <S>::MAX_EXP + 1, category: Category::Infinity, sign: false, marker: PhantomData,}
Positive Infinity.
const NAN: Self
NAN: Self = IeeeFloat{sig: [<S>::QNAN_SIGNIFICAND], exp: <S>::MAX_EXP + 1, category: Category::NaN, sign: false, marker: PhantomData,}
NaN (Not a Number).
fn qnan(payload: Option<u128>) -> Self
[src]
fn qnan(payload: Option<u128>) -> Self
Factory for QNaN values.
fn snan(payload: Option<u128>) -> Self
[src]
fn snan(payload: Option<u128>) -> Self
Factory for SNaN values.
fn largest() -> Self
[src]
fn largest() -> Self
Largest finite number.
const SMALLEST: Self
SMALLEST: Self = IeeeFloat{sig: [1], exp: <S>::MIN_EXP, category: Category::Normal, sign: false, marker: PhantomData,}
Smallest (by magnitude) finite number. Might be denormalized, which implies a relative loss of precision. Read more
fn smallest_normalized() -> Self
[src]
fn smallest_normalized() -> Self
Smallest (by magnitude) normalized finite number.
fn add_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
fn add_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
fn mul_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
fn mul_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
fn mul_add_r(
self,
multiplicand: Self,
addend: Self,
round: Round
) -> StatusAnd<Self>
[src]
fn mul_add_r(
self,
multiplicand: Self,
addend: Self,
round: Round
) -> StatusAnd<Self>
fn div_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
fn div_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
fn c_fmod(self, rhs: Self) -> StatusAnd<Self>
[src]
fn c_fmod(self, rhs: Self) -> StatusAnd<Self>
C fmod, or llvm frem.
fn round_to_integral(self, round: Round) -> StatusAnd<Self>
[src]
fn round_to_integral(self, round: Round) -> StatusAnd<Self>
fn next_up(self) -> StatusAnd<Self>
[src]
fn next_up(self) -> StatusAnd<Self>
IEEE-754R 2008 5.3.1: nextUp.
fn from_bits(input: u128) -> Self
[src]
fn from_bits(input: u128) -> Self
fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self>
[src]
fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self>
fn from_str_r(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError>
[src]
fn from_str_r(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError>
fn to_bits(self) -> u128
[src]
fn to_bits(self) -> u128
fn to_u128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<u128>
[src]
fn to_u128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<u128>
fn cmp_abs_normal(self, rhs: Self) -> Ordering
[src]
fn cmp_abs_normal(self, rhs: Self) -> Ordering
fn bitwise_eq(self, rhs: Self) -> bool
[src]
fn bitwise_eq(self, rhs: Self) -> bool
Bitwise comparison for equality (QNaNs compare equal, 0!=-0).
fn is_negative(self) -> bool
[src]
fn is_negative(self) -> bool
IEEE-754R isSignMinus: Returns true if and only if the current value is negative. Read more
fn is_denormal(self) -> bool
[src]
fn is_denormal(self) -> bool
IEEE-754R isSubnormal(): Returns true if and only if the float is a denormal. Read more
fn is_signaling(self) -> bool
[src]
fn is_signaling(self) -> bool
Returns true if and only if the float is a signaling NaN.
fn category(self) -> Category
[src]
fn category(self) -> Category
fn get_exact_inverse(self) -> Option<Self>
[src]
fn get_exact_inverse(self) -> Option<Self>
If this value has an exact multiplicative inverse, return it.
fn ilogb(self) -> ExpInt
[src]
fn ilogb(self) -> ExpInt
Returns the exponent of the internal representation of the Float. Read more
fn scalbn_r(self, exp: ExpInt, round: Round) -> Self
[src]
fn scalbn_r(self, exp: ExpInt, round: Round) -> Self
Returns: self * 2exp for integral exponents.
fn frexp_r(self, exp: &mut ExpInt, round: Round) -> Self
[src]
fn frexp_r(self, exp: &mut ExpInt, round: Round) -> Self
Equivalent of C standard library function. Read more
fn sub_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
[src]
fn sub_r(self, rhs: Self, round: Round) -> StatusAnd<Self>
fn mul_add(self, multiplicand: Self, addend: Self) -> StatusAnd<Self>
[src]
fn mul_add(self, multiplicand: Self, addend: Self) -> StatusAnd<Self>
fn ieee_rem(self, rhs: Self) -> StatusAnd<Self>
[src]
fn ieee_rem(self, rhs: Self) -> StatusAnd<Self>
IEEE remainder.
fn next_down(self) -> StatusAnd<Self>
[src]
fn next_down(self) -> StatusAnd<Self>
IEEE-754R 2008 5.3.1: nextDown. Read more
fn abs(self) -> Self
[src]
fn abs(self) -> Self
fn copy_sign(self, rhs: Self) -> Self
[src]
fn copy_sign(self, rhs: Self) -> Self
fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self>
[src]
fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self>
fn from_i128(input: i128) -> StatusAnd<Self>
[src]
fn from_i128(input: i128) -> StatusAnd<Self>
fn from_u128(input: u128) -> StatusAnd<Self>
[src]
fn from_u128(input: u128) -> StatusAnd<Self>
fn to_i128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<i128>
[src]
fn to_i128_r(
self,
width: usize,
round: Round,
is_exact: &mut bool
) -> StatusAnd<i128>
Convert a floating point number to an integer according to the rounding mode. In case of an invalid operation exception, deterministic values are returned, namely zero for NaNs and the minimal or maximal value respectively for underflow or overflow. If the rounded value is in range but the floating point number is not the exact integer, the C standard doesn't require an inexact exception to be raised. IEEE-854 does require it so we do that. Read more
fn to_i128(self, width: usize) -> StatusAnd<i128>
[src]
fn to_i128(self, width: usize) -> StatusAnd<i128>
fn to_u128(self, width: usize) -> StatusAnd<u128>
[src]
fn to_u128(self, width: usize) -> StatusAnd<u128>
fn min(self, other: Self) -> Self
[src]
fn min(self, other: Self) -> Self
Implements IEEE minNum semantics. Returns the smaller of the 2 arguments if both are not NaN. If either argument is a NaN, returns the other argument. Read more
fn max(self, other: Self) -> Self
[src]
fn max(self, other: Self) -> Self
Implements IEEE maxNum semantics. Returns the larger of the 2 arguments if both are not NaN. If either argument is a NaN, returns the other argument. Read more
fn is_normal(self) -> bool
[src]
fn is_normal(self) -> bool
IEEE-754R isNormal: Returns true if and only if the current value is normal. Read more
fn is_finite(self) -> bool
[src]
fn is_finite(self) -> bool
Returns true if and only if the current value is zero, subnormal, or normal. Read more
fn is_zero(self) -> bool
[src]
fn is_zero(self) -> bool
Returns true if and only if the float is plus or minus zero.
fn is_infinite(self) -> bool
[src]
fn is_infinite(self) -> bool
IEEE-754R isInfinite(): Returns true if and only if the float is infinity.
fn is_nan(self) -> bool
[src]
fn is_nan(self) -> bool
Returns true if and only if the float is a quiet or signaling NaN.
fn is_non_zero(self) -> bool
[src]
fn is_non_zero(self) -> bool
fn is_finite_non_zero(self) -> bool
[src]
fn is_finite_non_zero(self) -> bool
fn is_pos_zero(self) -> bool
[src]
fn is_pos_zero(self) -> bool
fn is_neg_zero(self) -> bool
[src]
fn is_neg_zero(self) -> bool
fn is_smallest(self) -> bool
[src]
fn is_smallest(self) -> bool
Returns true if and only if the number has the smallest possible non-zero magnitude in the current semantics. Read more
fn is_largest(self) -> bool
[src]
fn is_largest(self) -> bool
Returns true if and only if the number has the largest possible finite magnitude in the current semantics. Read more
fn is_integer(self) -> bool
[src]
fn is_integer(self) -> bool
Returns true if and only if the number is an exact integer.
fn scalbn(self, exp: ExpInt) -> Self
[src]
fn scalbn(self, exp: ExpInt) -> Self
fn frexp(self, exp: &mut ExpInt) -> Self
[src]
fn frexp(self, exp: &mut ExpInt) -> Self
impl<S: Semantics, T: Semantics> FloatConvert<IeeeFloat<T>> for IeeeFloat<S>
[src]
impl<S: Semantics, T: Semantics> FloatConvert<IeeeFloat<T>> for IeeeFloat<S>
fn convert_r(
self,
round: Round,
loses_info: &mut bool
) -> StatusAnd<IeeeFloat<T>>
[src]
fn convert_r(
self,
round: Round,
loses_info: &mut bool
) -> StatusAnd<IeeeFloat<T>>
Convert a value of one floating point type to another. The return value corresponds to the IEEE754 exceptions. *loses_info records whether the transformation lost information, i.e. whether converting the result back to the original type will produce the original value (this is almost the same as return value==Status::OK, but there are edge cases where this is not so). Read more
fn convert(self, loses_info: &mut bool) -> StatusAnd<T>
[src]
fn convert(self, loses_info: &mut bool) -> StatusAnd<T>
impl<F: Float> From<IeeeFloat<FallbackS<F>>> for DoubleFloat<F> where
F: FloatConvert<IeeeFloat<FallbackExtendedS<F>>>,
IeeeFloat<FallbackExtendedS<F>>: FloatConvert<F>,
[src]
impl<F: Float> From<IeeeFloat<FallbackS<F>>> for DoubleFloat<F> where
F: FloatConvert<IeeeFloat<FallbackExtendedS<F>>>,
IeeeFloat<FallbackExtendedS<F>>: FloatConvert<F>,
impl<F: FloatConvert<Self>> From<DoubleFloat<F>> for IeeeFloat<FallbackS<F>>
[src]
impl<F: FloatConvert<Self>> From<DoubleFloat<F>> for IeeeFloat<FallbackS<F>>
fn from(DoubleFloat: DoubleFloat<F>) -> Self
[src]
fn from(DoubleFloat: DoubleFloat<F>) -> Self
Performs the conversion.