#[repr(C)]pub struct Ieee128 { /* private fields */ }
Expand description
An IEEE binary128 immediate floating point value, represented as a u128 containing the bit pattern.
We specifically avoid using a f128 here since some architectures may silently alter floats. See: https://github.com/bytecodealliance/wasmtime/pull/2251#discussion_r498508646
The PartialEq and Hash implementations are over the underlying bit pattern, but PartialOrd respects IEEE754 semantics.
All bit patterns are allowed.
Implementations§
Source§impl Ieee128
impl Ieee128
Sourcepub fn copysign(self, sign: Self) -> Self
pub fn copysign(self, sign: Self) -> Self
Returns a number composed of the magnitude of self
and the sign of sign
.
Sourcepub fn minimum(self, other: Self) -> Self
pub fn minimum(self, other: Self) -> Self
Returns the minimum of self
and other
, following the WebAssembly/IEEE 754-2019 definition.
Sourcepub fn maximum(self, other: Self) -> Self
pub fn maximum(self, other: Self) -> Self
Returns the maximum of self
and other
, following the WebAssembly/IEEE 754-2019 definition.
Sourcepub fn fcvt_to_sint_negative_overflow<I: Into<i32>>(n: I) -> Self
pub fn fcvt_to_sint_negative_overflow<I: Into<i32>>(n: I) -> Self
Create an
Ieee128
number representing the greatest negative value not convertible from
f128
to a signed integer with width n.
Sourcepub fn is_nan(self) -> bool
pub fn is_nan(self) -> bool
Check if the value is a NaN. For
Ieee128
,
this means checking that all the exponent bits are set and the significand is non-zero.
Sourcepub fn is_positive(self) -> bool
pub fn is_positive(self) -> bool
Returns true if self
has a negative sign, including 0.0, NaNs with positive sign bit and positive infinity.
Sourcepub fn is_negative(self) -> bool
pub fn is_negative(self) -> bool
Returns true if self
has a negative sign, including -0.0, NaNs with negative sign bit and negative infinity.
Trait Implementations§
Source§impl From<Ieee128> for ConstantData
impl From<Ieee128> for ConstantData
Source§impl PartialOrd for Ieee128
impl PartialOrd for Ieee128
Source§impl TryFrom<&ConstantData> for Ieee128
impl TryFrom<&ConstantData> for Ieee128
impl Copy for Ieee128
impl Eq for Ieee128
impl StructuralPartialEq for Ieee128
Auto Trait Implementations§
impl Freeze for Ieee128
impl RefUnwindSafe for Ieee128
impl Send for Ieee128
impl Sync for Ieee128
impl Unpin for Ieee128
impl UnwindSafe for Ieee128
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.