#[repr(transparent)]pub struct F4(pub u8);Expand description
Finite-only 4-bit float: E3M0 with the top exponent reserved for NaN.
Tuple Fields§
§0: u8Implementations§
Source§impl F4
impl F4
Trait Implementations§
Source§impl AddAssign for F4
impl AddAssign for F4
Source§fn add_assign(&mut self, rhs: F4)
fn add_assign(&mut self, rhs: F4)
Performs the
+= operation. Read moreimpl Copy for F4
Source§impl FloatElement for F4
impl FloatElement for F4
Source§fn signum(self) -> Self
fn signum(self) -> Self
Sign of
self: 1 for positive/+0, -1 for negative/-0, NaN for
NaN (matching f64::signum / num_traits::Float::signum).Source§fn powi(self, n: i32) -> Self
fn powi(self, n: i32) -> Self
self raised to an integer power via exponentiation by squaring. Read moreSource§fn erfc(self) -> Self
fn erfc(self) -> Self
Complementary error function
erfc(self) = 1 - erf(self), computed without
the cancellation error of 1 - erf for large self.Source§fn lgamma(self) -> Self
fn lgamma(self) -> Self
Natural logarithm of the absolute value of the gamma function,
ln|Γ(self)|.Source§fn default_epsilon() -> Selfwhere
Self: RealField,
fn default_epsilon() -> Selfwhere
Self: RealField,
Machine epsilon (
nalgebra::RealField::default_epsilon compatibility alias). Read moreSource§fn pi() -> Selfwhere
Self: RealField,
fn pi() -> Selfwhere
Self: RealField,
Returns
π as this float type (nalgebra compatibility alias for RealField::PI).Source§fn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Componentwise maximum (method form; prefer
NumericElement::max_scalar in new code).Source§impl MulAssign for F4
impl MulAssign for F4
Source§fn mul_assign(&mut self, rhs: F4)
fn mul_assign(&mut self, rhs: F4)
Performs the
*= operation. Read moreSource§impl NumericElement for F4
impl NumericElement for F4
Source§const MIN_VALUE: F4
const MIN_VALUE: F4
The minimum representable finite value (negative infinity or
i32::MIN). Read moreSource§const MAX_VALUE: F4
const MAX_VALUE: F4
The maximum representable finite value (positive infinity or
i32::MAX). Read moreSource§const BYTE_WIDTH: usize = 1
const BYTE_WIDTH: usize = 1
Number of bytes per element.
Source§fn sqrt(self) -> F4
fn sqrt(self) -> F4
Square root. Floats follow IEEE 754 (
NaN for negative inputs); integers
return the exact floor integer square root (isqrt), with negative signed
inputs defined to return 0 (integers have no NaN to signal the domain
error). No f64 round-trip, so the integer result is exact for all operands.Source§fn count_ones(self) -> u32
fn count_ones(self) -> u32
Count set bits (population count).
Source§fn min_scalar(self, other: Self) -> Selfwhere
Self: PartialOrd,
fn min_scalar(self, other: Self) -> Selfwhere
Self: PartialOrd,
Source§fn max_scalar(self, other: Self) -> Selfwhere
Self: PartialOrd,
fn max_scalar(self, other: Self) -> Selfwhere
Self: PartialOrd,
Source§fn saturating_add(self, rhs: Self) -> Self
fn saturating_add(self, rhs: Self) -> Self
Saturating addition. Read more
Source§fn saturating_mul(self, rhs: Self) -> Self
fn saturating_mul(self, rhs: Self) -> Self
Saturating multiplication. Read more
Source§fn checked_add(self, rhs: Self) -> Option<Self>
fn checked_add(self, rhs: Self) -> Option<Self>
Source§fn checked_mul(self, rhs: Self) -> Option<Self>
fn checked_mul(self, rhs: Self) -> Option<Self>
Source§impl Packable4 for F4
impl Packable4 for F4
Source§fn unpack_slice_packed(packed: &[u8], unpacked: &mut [F32])
fn unpack_slice_packed(packed: &[u8], unpacked: &mut [F32])
Unpack a slice of packed pairs to a slice of unpacked elements.
Source§fn unpack_single(element: F4) -> F32
fn unpack_single(element: F4) -> F32
Unpack a single element.
Source§impl PartialOrd for F4
impl PartialOrd for F4
impl Pod for F4
impl Pod for F4
Source§impl RemAssign for F4
impl RemAssign for F4
Source§fn rem_assign(&mut self, rhs: F4)
fn rem_assign(&mut self, rhs: F4)
Performs the
%= operation. Read moreimpl StructuralPartialEq for F4
Source§impl SubAssign for F4
impl SubAssign for F4
Source§fn sub_assign(&mut self, rhs: F4)
fn sub_assign(&mut self, rhs: F4)
Performs the
-= operation. Read moreSource§impl UnitScalar for F4
impl UnitScalar for F4
Source§fn scale_by_f64(self, factor: f64) -> F4
fn scale_by_f64(self, factor: f64) -> F4
Scale this value by a real coefficient in the scalar’s native precision.
Auto Trait Implementations§
impl Freeze for F4
impl RefUnwindSafe for F4
impl Send for F4
impl Sync for F4
impl Unpin for F4
impl UnsafeUnpin for F4
impl UnwindSafe for F4
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.