Trait datafusion_common::rounding::FloatBits
source · pub trait FloatBits {
type Item: Copy + PartialEq + BitAnd<Output = Self::Item> + Add<Output = Self::Item> + Sub<Output = Self::Item>;
const TINY_BITS: Self::Item;
const NEG_TINY_BITS: Self::Item;
const CLEAR_SIGN_MASK: Self::Item;
const ONE: Self::Item;
const ZERO: Self::Item;
// Required methods
fn to_bits(self) -> Self::Item;
fn from_bits(bits: Self::Item) -> Self;
fn float_is_nan(self) -> bool;
fn infinity() -> Self;
fn neg_infinity() -> Self;
}
Expand description
A trait to manipulate floating-point types with bitwise operations. Provides functions to convert a floating-point value to/from its bitwise representation as well as utility methods to handle special values.
Required Associated Types§
Required Associated Constants§
sourceconst TINY_BITS: Self::Item
const TINY_BITS: Self::Item
The smallest positive floating-point value representable by this type.
sourceconst NEG_TINY_BITS: Self::Item
const NEG_TINY_BITS: Self::Item
The smallest (in magnitude) negative floating-point value representable by this type.
sourceconst CLEAR_SIGN_MASK: Self::Item
const CLEAR_SIGN_MASK: Self::Item
A mask to clear the sign bit of the floating-point value’s bitwise representation.
Required Methods§
sourcefn to_bits(self) -> Self::Item
fn to_bits(self) -> Self::Item
Converts the floating-point value to its bitwise representation.
sourcefn from_bits(bits: Self::Item) -> Self
fn from_bits(bits: Self::Item) -> Self
Converts the bitwise representation to the corresponding floating-point value.
sourcefn float_is_nan(self) -> bool
fn float_is_nan(self) -> bool
Returns true if the floating-point value is NaN (not a number).
sourcefn neg_infinity() -> Self
fn neg_infinity() -> Self
Returns the negative infinity value for this floating-point type.
Object Safety§
This trait is not object safe.