Skip to main content

Multi

Enum Multi 

Source
pub enum Multi {
    Standard(Algebraic),
    One(Closed, Arc<Scale>),
    Over {
        scale: Arc<Scale>,
        q: u32,
        num: PolyOver<Multi>,
        den: PolyOver<Multi>,
    },
    Alg(Arc<AlgValue>),
}
Expand description

A value of several ordered infinitesimals. See the module documentation.

Variants§

§

Standard(Algebraic)

A standard number.

§

One(Closed, Arc<Scale>)

A value of one infinitesimal, not standard.

§

Over

num/den in scale^(1/q), every coefficient a value of larger infinitesimals and at least one not standard.

Fields

§scale: Arc<Scale>
§

Alg(Arc<AlgValue>)

A value of the real closure at its smallest infinitesimal that is no rational function of a root of it (crate::closure).

Implementations§

Source§

impl Multi

Source

pub fn generator(scale: &Arc<Scale>) -> Multi

The infinitesimal itself.

Source

pub fn of_closed(c: Closed, scale: &Arc<Scale>) -> Multi

A value of one infinitesimal, in its one form.

Source

pub fn top(&self) -> Option<&Arc<Scale>>

The smallest infinitesimal the value involves; None for a standard number.

Source

pub fn scales(&self) -> Vec<Arc<Scale>>

Every infinitesimal the value involves, each once, with the facts all of its parts state.

Source

pub fn standard_part_at(&self, at: Option<&Arc<Scale>>) -> Option<Multi>

What the value is infinitely close to among the values of at and the infinitesimals larger than it, when it is limited from at’s standpoint: every infinitesimal smaller than at read at zero, the inner limit with at held fixed. With no at, the standard part. None for a value infinite from that standpoint. Every infinitesimal of the value is ordered with at.

Source

pub fn standard_part(&self) -> Option<Algebraic>

The standard real infinitely close to a limited value; None for an infinite one.

Source

pub fn is_infinitesimal_at(&self, at: Option<&Arc<Scale>>) -> bool

Zero, or smaller than every positive value of at and the infinitesimals larger than it (every positive standard number, with no at).

Source

pub fn is_limited_at(&self, at: Option<&Arc<Scale>>) -> bool

Bounded by a value of at and the infinitesimals larger than it (a standard number, with no at).

Source

pub fn is_infinitesimal(&self) -> bool

Source

pub fn is_limited(&self) -> bool

Source

pub fn pow(&self, k: i32) -> Result<Multi, MultiPowerError>

self^k; refused for zero to a negative power and for a degree past crate::hyperreal::MAX_POWER_DEGREE in any of the value’s infinitesimals.

Source

pub fn root(&self, n: u32) -> Result<Multi, String>

The real n-th root, the nonnegative one for an even n: of a value of one infinitesimal in its real closure, and of a product of a power of the smallest infinitesimal and a value of the larger ones as the product of their roots.

Source§

impl Multi

Source

pub fn render(&self) -> String

The value as an exact fraction of polynomials in its infinitesimals, as a hyperreal prints: a polynomial with its coefficients as they are, (1/2)·dt + dx, and any other value as a fraction of polynomials with coprime integer coefficients where every coefficient is rational, dx/(2·dt). An infinite integer prints as one of one infinitesimal does, a sum of reciprocals (Multi::render_reciprocals), wherever it is printed — alone, under a radical, as a coefficient.

Source§

impl Multi

Source

pub fn to_bytes(&self) -> Vec<u8> ⓘ

The value’s canonical bytes: each infinitesimal it involves once, by its name, its declaration (Scale::to_bytes) and the facts about its reciprocal the value holds it with — a residue class’s, on which an infinite integer of several is one — in the order a walk of the value first meets them; then the value, each infinitesimal written by its place among them.

Source

pub fn from_bytes(buf: &[u8]) -> Option<Multi>

The value Multi::to_bytes wrote; None for a forged or non-canonical encoding.

Trait Implementations§

Source§

impl Clone for Multi

Source§

fn clone(&self) -> Multi

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 Coefficient for Multi

A value of several infinitesimals is the coefficient of an expansion in a smaller one, exactly.

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn of_rational(r: Rational) -> Self

Source§

fn add(&self, o: &Self) -> Result<Self, ExpansionError>

Source§

fn sub(&self, o: &Self) -> Result<Self, ExpansionError>

Source§

fn neg(&self) -> Result<Self, ExpansionError>

Source§

fn mul(&self, o: &Self) -> Result<Self, ExpansionError>

Source§

fn is_zero(&self) -> Result<bool, ExpansionError>

Whether the coefficient is zero; refused when that cannot be told.
Source§

fn recip(&self) -> Result<Self, ExpansionError>

Source§

fn sign(&self) -> Result<i32, ExpansionError>

−1, 0 or 1; refused when the sign cannot be told.
Source§

fn nth_root(&self, n: u32) -> Result<Self, ExpansionError>

The real n-th root, the nonnegative one for an even n.
Source§

fn exp(&self) -> Result<Self, ExpansionError>

exp, for an expansion’s exponential.
Source§

fn ln(&self) -> Result<Self, ExpansionError>

The natural logarithm of a positive coefficient, for an expansion’s logarithm.
Source§

impl Debug for Multi

Source§

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

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

impl Hash for Multi

Source§

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

Equal values have one form, and one infinitesimal one name.

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 OrderedField for Multi

Source§

fn zero() -> Self

Source§

fn one() -> Self

Source§

fn from_i64(n: i64) -> Self

Source§

fn is_zero(&self) -> bool

Source§

fn add(&self, o: &Self) -> Self

Source§

fn neg(&self) -> Self

Source§

fn mul(&self, o: &Self) -> Self

Source§

fn recip(&self) -> Option<Self>

None for zero.
Source§

fn signum(&self) -> i32

−1, 0 or 1.
Source§

fn sub(&self, o: &Self) -> Self

Source§

impl PartialEq for Multi

Source§

fn eq(&self, o: &Self) -> 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 Eq for Multi

Auto Trait Implementations§

§

impl Freeze for Multi

§

impl !RefUnwindSafe for Multi

§

impl Send for Multi

§

impl Sync for Multi

§

impl Unpin for Multi

§

impl UnsafeUnpin for Multi

§

impl !UnwindSafe for Multi

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 = 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.