pub enum Number {
Int(BigInt),
Rat(Rational),
Bool(bool),
Nothing,
Alg(Algebraic),
Real(ExactReal),
Hyper(HyperValue),
Nat(NaturalValue),
Ord(Ordinal),
Dep(Box<DependsValue<Number>>),
Conv(Box<Converging<Number>>),
}Expand description
A number of the exact tower. See the module documentation.
Variants§
Int(BigInt)
Rat(Rational)
Bool(bool)
Nothing
Alg(Algebraic)
Real(ExactReal)
Hyper(HyperValue)
Nat(NaturalValue)
Ord(Ordinal)
Dep(Box<DependsValue<Number>>)
Conv(Box<Converging<Number>>)
Implementations§
Trait Implementations§
Source§impl Coefficient for Number
impl Coefficient for Number
fn zero() -> Self
fn one() -> Self
fn of_rational(r: Rational) -> Self
fn add(&self, o: &Self) -> Result<Self, ExpansionError>
fn sub(&self, o: &Self) -> Result<Self, ExpansionError>
fn neg(&self) -> Result<Self, ExpansionError>
fn mul(&self, o: &Self) -> Result<Self, ExpansionError>
Source§fn is_zero(&self) -> Result<bool, ExpansionError>
fn is_zero(&self) -> Result<bool, ExpansionError>
Whether the coefficient is zero; refused when that cannot be told.
fn recip(&self) -> Result<Self, ExpansionError>
Source§fn sign(&self) -> Result<i32, ExpansionError>
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>
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>
fn exp(&self) -> Result<Self, ExpansionError>
exp, for an expansion’s exponential.Source§fn ln(&self) -> Result<Self, ExpansionError>
fn ln(&self) -> Result<Self, ExpansionError>
The natural logarithm of a positive coefficient, for an expansion’s logarithm.
Source§impl TowerValue for Number
impl TowerValue for Number
Source§fn exact(&self) -> Option<ExactRef<'_, Self>>
fn exact(&self) -> Option<ExactRef<'_, Self>>
The value as one of the exact types, or
None for any other value.Source§fn standard_rational(&self) -> Option<Rational>
fn standard_rational(&self) -> Option<Rational>
An integer, rational, decimal or finite float as the rational it denotes exactly.
Source§fn exact_rational(&self) -> Option<Rational>
fn exact_rational(&self) -> Option<Rational>
An integer or a rational: a number held exactly, never a float or a decimal.
Source§fn is_standard_number(&self) -> bool
fn is_standard_number(&self) -> bool
An integer, rational, decimal or float: its own standard part.
Source§fn display_string(&self) -> String
fn display_string(&self) -> String
How the value prints.
Source§fn values_equal(&self, other: &Self) -> bool
fn values_equal(&self, other: &Self) -> bool
The language’s equality on two values.
Source§fn is_nothing(&self) -> bool
fn is_nothing(&self) -> bool
Whether the value is
nothing.Source§fn from_rational(r: Rational) -> Self
fn from_rational(r: Rational) -> Self
A rational in its smallest form: an
Int when it fits, a big integer, else a rational.Source§fn from_bigint(b: BigInt) -> Self
fn from_bigint(b: BigInt) -> Self
An integer in its smallest form.
fn boolean(b: bool) -> Self
fn nothing() -> Self
fn algebraic(a: Algebraic) -> Self
fn exact_real(x: ExactReal) -> Self
fn hyper(h: HyperValue) -> Self
fn natural(n: NaturalValue) -> Self
fn ordinal(o: Ordinal) -> Self
fn depends(d: DependsValue<Self>) -> Self
fn converging(c: Converging<Self>) -> Self
Auto Trait Implementations§
impl Freeze for Number
impl !RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnsafeUnpin for Number
impl !UnwindSafe for Number
Blanket Implementations§
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