Skip to main content

Extended80

Struct Extended80 

Source
pub struct Extended80 {
    pub sign_exponent: u16,
    pub significand: u64,
}
Expand description

An x87 double-extended value: the ten bytes that carry it.

Held as (exponent_and_sign, significand) rather than as bytes because the padding is not part of the value, and a type that carried the padding would invite a caller to compare two of them and find them different for a reason that is not the number.

Fields§

§sign_exponent: u16

Sign in bit 15, biased exponent in bits 0..=14.

§significand: u64

The significand, with the integer bit explicit in bit 63.

Implementations§

Source§

impl Extended80

Source

pub const fn from_le_bytes(bytes: [u8; 10]) -> Self

From the ten bytes as x86 stores them, least significant first.

Source

pub const fn to_le_bytes(self) -> [u8; 10]

The ten bytes, least significant first.

Source

pub const fn from_padded_le_bytes(bytes: [u8; 16]) -> Self

From the sixteen bytes a Fast DDS or OpenDDS payload holds on x86-64: the ten that matter, then six the compiler did not write.

The trailing six bytes are ignored. They are padding in the C object and were measured carrying leftover stack — a reader that folded them into the value would decode the same number differently on two runs of the same writer.

Source

pub const fn to_padded_le_bytes(self) -> [u8; 16]

The sixteen bytes with the padding zeroed.

Zeroed rather than left uninitialised because XTypes 1.3 §7.4.1.1 requires trailing padding in a serialised sample to be zero, and because six bytes of process memory on a multicast group is a disclosure whatever the specification says about it.

Source

pub const fn is_sign_negative(self) -> bool

The sign bit.

Source

pub const fn biased_exponent(self) -> u32

The biased exponent.

Trait Implementations§

Source§

impl Clone for Extended80

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Extended80

Source§

impl Debug for Extended80

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Extended80

Source§

impl Hash for Extended80

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Extended80

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Extended80

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.