Struct Quad

Source
#[repr(C)]
pub struct Quad<T = f64>(pub T, pub T);
Expand description

extended precision floating point type.

math operations assume that self.1.abs() < self.0.abs() * ulp / 2.0

Tuple Fields§

§0: T§1: T

Implementations§

Source§

impl Quad

Source

pub const RADIX: u32 = 2u32

Source

pub const MANTISSA_DIGITS: u32 = 105u32

Source

pub const DIGITS: u32 = 31u32

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub const INFINITY: Self

Source

pub const NEG_INFINITY: Self

Source

pub const NAN: Self

Source

pub const EPSILON: Self

Source

pub const MAX: Self

Source

pub const MIN: Self

Source

pub const MIN_POSITIVE: Self

Source

pub const MIN_EXP: i32 = -1_021i32

Source

pub const MAX_EXP: i32 = 1_024i32

Source

pub const LN_2: Self

Source

pub const FRAC_1_LN_2: Self

Source

pub const LN_10: Self

Source

pub const FRAC_1_LN_10: Self

Source

pub const PI: Self

Source

pub const fn from_f64(value: f64) -> Self

Source

pub const fn add_estimate(self, rhs: Self) -> Self

Source

pub const fn add_accurate(self, rhs: Self) -> Self

Source

pub const fn sub_estimate(self, rhs: Self) -> Self

Source

pub const fn sub_accurate(self, rhs: Self) -> Self

Source

pub const fn neg(self) -> Self

Source

pub const fn abs(self) -> Self

Source

pub fn mul(self, rhs: Self) -> Self

Source

pub const fn const_mul(self, rhs: Self) -> Self

Source

pub const fn const_div(self, rhs: Self) -> Self

Source

pub const fn const_recip(self) -> Self

Source

pub fn recip(self) -> Self

Source

pub fn div(self, rhs: Self) -> Self

Source

pub const fn eq(self, rhs: Self) -> bool

Source

pub const fn ne(self, rhs: Self) -> bool

Source

pub const fn is_nan(self) -> bool

Source

pub const fn is_finite(self) -> bool

Source

pub const fn partial_cmp(self, rhs: Self) -> Option<Ordering>

Source

pub const fn lt(self, rhs: Self) -> bool

Source

pub const fn le(self, rhs: Self) -> bool

Source

pub const fn gt(self, rhs: Self) -> bool

Source

pub const fn ge(self, rhs: Self) -> bool

Source

pub const fn const_sqrt(self) -> Self

Source

pub fn sqrt(self) -> Self

Source

pub fn exp(self) -> Self

Source

pub fn ln(self) -> Self

Source

pub fn log2(self) -> Self

Source

pub fn log10(self) -> Self

Source

pub fn trunc(self) -> Self

Trait Implementations§

Source§

impl Add for &Quad

Source§

type Output = Quad

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Quad

Source§

type Output = Quad

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<&Quad> for Quad

Source§

fn add_assign(&mut self, rhs: &Quad)

Performs the += operation. Read more
Source§

impl AddAssign for Quad

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<T: Clone> Clone for Quad<T>

Source§

fn clone(&self) -> Quad<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Quad<T>

Source§

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

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

impl Div for &Quad

Source§

type Output = Quad

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for Quad

Source§

type Output = Quad

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<&Quad> for Quad

Source§

fn div_assign(&mut self, rhs: &Quad)

Performs the /= operation. Read more
Source§

impl DivAssign for Quad

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl From<f64> for Quad

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl Mul for &Quad

Source§

type Output = Quad

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Quad

Source§

type Output = Quad

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<&Quad> for Quad

Source§

fn mul_assign(&mut self, rhs: &Quad)

Performs the *= operation. Read more
Source§

impl MulAssign for Quad

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for &Quad

Source§

type Output = Quad

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for Quad

Source§

type Output = Quad

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Num for Quad

Source§

type FromStrRadixErr = ParseFloatError

Source§

fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl One for Quad

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl<T: PartialEq> PartialEq for Quad<T>

Source§

fn eq(&self, other: &Quad<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd> PartialOrd for Quad<T>

Source§

fn partial_cmp(&self, other: &Quad<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem for &Quad

Source§

type Output = Quad

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for Quad

Source§

type Output = Quad

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl RemAssign<&Quad> for Quad

Source§

fn rem_assign(&mut self, rhs: &Quad)

Performs the %= operation. Read more
Source§

impl RemAssign for Quad

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl Sub for &Quad

Source§

type Output = Quad

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Quad

Source§

type Output = Quad

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<&Quad> for Quad

Source§

fn sub_assign(&mut self, rhs: &Quad)

Performs the -= operation. Read more
Source§

impl SubAssign for Quad

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl Zero for Quad

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<T: Zeroable> Zeroable for Quad<T>

Source§

fn zeroed() -> Self

Source§

impl<T: Copy> Copy for Quad<T>

Source§

impl<T: Pod> Pod for Quad<T>

Source§

impl<T> StructuralPartialEq for Quad<T>

Auto Trait Implementations§

§

impl<T> Freeze for Quad<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Quad<T>
where T: RefUnwindSafe,

§

impl<T> Send for Quad<T>
where T: Send,

§

impl<T> Sync for Quad<T>
where T: Sync,

§

impl<T> Unpin for Quad<T>
where T: Unpin,

§

impl<T> UnwindSafe for Quad<T>
where T: UnwindSafe,

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> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

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

If this function returns true, then it must be valid to reinterpret bits as &Self.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> Interleave for T
where T: Pod,

Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,