Struct cranelift_codegen::ir::immediates::Ieee64
source · [−]#[repr(C)]pub struct Ieee64(_);
Expand description
An IEEE binary64 immediate floating point value, represented as a u64 containing the bit pattern.
We specifically avoid using a f64 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
sourceimpl Ieee64
impl Ieee64
sourcepub fn fcvt_to_sint_negative_overflow<I: Into<i64>>(n: I) -> Self
pub fn fcvt_to_sint_negative_overflow<I: Into<i64>>(n: I) -> Self
Create an Ieee64
number representing the greatest negative value
not convertable from f64 to a signed integer with width n.
sourcepub fn with_float(x: f64) -> Self
pub fn with_float(x: f64) -> Self
Create a new Ieee64
representing the number x
.
sourcepub fn is_nan(&self) -> bool
pub fn is_nan(&self) -> bool
Check if the value is a NaN. For Ieee64, this means checking that the 11 exponent bits are all set.
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 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.
sourcepub fn trunc(self) -> Self
pub fn trunc(self) -> Self
Returns the integer part of self
. This means that non-integer numbers are always truncated towards zero.
sourcepub fn round_ties_even(self) -> Self
pub fn round_ties_even(self) -> Self
Returns the nearest integer to self
. Rounds half-way cases to the number
with an even least significant digit.
Trait Implementations
sourceimpl IntoBytes for Ieee64
impl IntoBytes for Ieee64
sourcefn into_bytes(self) -> Vec<u8>
fn into_bytes(self) -> Vec<u8>
Return the little-endian byte representation of the implementing type.
sourceimpl PartialOrd<Ieee64> for Ieee64
impl PartialOrd<Ieee64> for Ieee64
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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
impl Copy for Ieee64
impl Eq for Ieee64
impl StructuralEq for Ieee64
impl StructuralPartialEq for Ieee64
Auto Trait Implementations
impl RefUnwindSafe for Ieee64
impl Send for Ieee64
impl Sync for Ieee64
impl Unpin for Ieee64
impl UnwindSafe for Ieee64
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more