Skip to main content

IntegerOps

Struct IntegerOps 

Source
pub struct IntegerOps<T> {
    pub variant: Variant,
    /* private fields */
}

Fields§

§variant: Variant

Implementations§

Source§

impl<T> IntegerOps<T>

Source

pub fn new(variant: Variant) -> IntegerOps<T>

Source§

impl<T> IntegerOps<T>
where T: Overflowing,

Source

pub fn result(&self, value: i64) -> T

Trait Implementations§

Source§

impl<T> Ops<f64> for IntegerOps<T>
where T: Overflowing,

Source§

type V = T

A value.
Source§

type B = bool

A truth value.
Source§

type I = u64

Integer bits at the resolved working width.
Source§

type W = f64

A binary64 temporary for short mixed-width reductions.
Source§

fn width(&self) -> FloatWidth

Source§

fn fused(&self) -> bool

Source§

fn integral(&self) -> bool

Whether values are integers, as a compiler’s values at an integer type are. A recipe for an integer object asks before taking an integer-only step (Binary::BitAnd). Floats never are.
Source§

fn widen(&self, x: T) -> f64

Source§

fn wide_number(&self, x: f64) -> f64

Source§

fn wide_multiply_add(&self, x: f64, y: f64, z: f64) -> f64

Source§

fn narrow(&self, x: f64) -> T

Source§

fn integer(&self, x: i64) -> u64

Source§

fn integer_op(&self, op: Integer, x: u64, y: u64) -> u64

Source§

fn integer_compare(&self, op: Cmp, x: u64, y: u64) -> bool

Source§

fn integer_select(&self, test: bool, x: u64, y: u64) -> u64

Source§

fn to_integer(&self, x: T) -> u64

Source§

fn from_integer(&self, x: u64) -> T

Source§

fn to_bits(&self, x: T) -> u64

Source§

fn from_bits(&self, x: u64) -> T

Source§

fn number(&self, x: f64) -> T

The number x.
Source§

fn unary(&self, op: Unary, x: T) -> T

Source§

fn binary(&self, op: Binary, x: T, y: T) -> T

Source§

fn overflow(&self, op: Binary, x: T, y: T) -> bool

Source§

fn compare(&self, c: Cmp, x: T, y: T) -> bool

Source§

fn and(&self, x: bool, y: bool) -> bool

Source§

fn or(&self, x: bool, y: bool) -> bool

Source§

fn not(&self, x: bool) -> bool

Source§

fn select(&self, test: bool, x: T, y: T) -> T

x where m holds, otherwise y. ∂’s recorder runs a recipe on whole values, where m and each array case must have one layout: build them from the same arguments.
Source§

fn multiply_add(&self, x: T, y: T, z: T) -> T

x·y + z, rounded once where the target fuses multiply-add (FUSED), as rustymath’s mla gives it.
Source§

fn one_where(&self, m: Self::B) -> Self::V

1 where m holds, otherwise 0.
Source§

fn constant(&self, _v: Self::V) -> Option<F>

v where it’s one number that every item shares, known before any item is read, such as the 3 of x^3. A recipe can pick a cheaper formula by it. None where v varies by item.
Source§

fn tolerance(&self, fallback: F) -> Self::V

Captured tolerance; recording backends return its runtime setting slot.
Source§

fn sign(&self, x: Self::V) -> Self::V

The sign of x, as sign gives it.
Source§

fn reciprocal(&self, x: Self::V) -> Self::V

1 ÷ x, as reciprocal gives it.
Source§

fn power(&self, k: F, x: Self::V) -> Self::V

x raised to k, a constant that Exponent::of routes off the general route, as power gives it.
Source§

fn real_power(&self, x: Self::V, y: Self::V) -> Self::V

The real part of x^y through the existing power formula.
Source§

fn power_slope( &self, x: Self::V, y: Self::V, r: Self::V, halves: bool, ) -> Self::V

The partial in x of x^y = r; halves permits constant half-integer powers.
Source§

fn negate(&self, x: Self::V) -> Self::V

Source§

fn magnitude(&self, x: Self::V) -> Self::V

Source§

fn sqrt(&self, x: Self::V) -> Self::V

Source§

fn floor(&self, x: Self::V) -> Self::V

Source§

fn ln(&self, x: Self::V) -> Self::V

Source§

fn sin(&self, x: Self::V) -> Self::V

Source§

fn cos(&self, x: Self::V) -> Self::V

Source§

fn sinh(&self, x: Self::V) -> Self::V

Source§

fn cosh(&self, x: Self::V) -> Self::V

Source§

fn sqrt1mx2(&self, x: Self::V) -> Self::V

Source§

fn sqrt1px2(&self, x: Self::V) -> Self::V

Source§

fn digamma(&self, x: Self::V) -> Self::V

Source§

fn exp(&self, x: Self::V) -> Self::V

Source§

fn lgamma(&self, x: Self::V) -> Self::V

Source§

fn complement(&self, x: Self::V) -> Self::V

Source§

fn add(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn subtract(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn multiply(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn divide(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn larger(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn smaller(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn binom(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn binom_dn(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn binom_dk(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn polygamma(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn bit_and(&self, x: Self::V, y: Self::V) -> Self::V

Source§

fn less(&self, x: Self::V, y: Self::V) -> Self::B

Source§

fn less_equal(&self, x: Self::V, y: Self::V) -> Self::B

Source§

fn equal(&self, x: Self::V, y: Self::V) -> Self::B

Auto Trait Implementations§

§

impl<T> Forget for IntegerOps<T>

§

impl<T> Freeze for IntegerOps<T>
where PhantomData<T>: Freeze,

§

impl<T> RefUnwindSafe for IntegerOps<T>

§

impl<T> Send for IntegerOps<T>
where PhantomData<T>: Send,

§

impl<T> Sync for IntegerOps<T>
where PhantomData<T>: Sync,

§

impl<T> Unpin for IntegerOps<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for IntegerOps<T>

§

impl<T> UnwindSafe for IntegerOps<T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.