pub struct ComputableReal { /* private fields */ }Expand description
A computable real number (Level 3 of the tower).
Implementations§
Source§impl ComputableReal
impl ComputableReal
Sourcepub fn evaluate(&self, precision: u64) -> RnsRational
pub fn evaluate(&self, precision: u64) -> RnsRational
Approximate to precision decimal places, memoizing the result.
Sourcepub fn evaluate_f64(&self) -> f64
pub fn evaluate_f64(&self) -> f64
Convenience: evaluate at roughly f64 precision.
Sourcepub fn from_rational(r: RnsRational) -> Self
pub fn from_rational(r: RnsRational) -> Self
A constant rational.
Sourcepub fn from_algebraic(a: AlgebraicNumber) -> Self
pub fn from_algebraic(a: AlgebraicNumber) -> Self
Drop a Level-2 algebraic number down to Level 3 for digit production.
Sourcepub fn sqrt(r: RnsRational) -> Self
pub fn sqrt(r: RnsRational) -> Self
√r by Newton’s method on rationals (quadratic convergence).
Sourcepub fn exp(r: RnsRational) -> Self
pub fn exp(r: RnsRational) -> Self
exp(r) via the Taylor series Σ rᵏ/k!.
Sourcepub fn ln(r: RnsRational) -> Self
pub fn ln(r: RnsRational) -> Self
ln(r) for r > 0 via 2·atanh((r-1)/(r+1)).
Trait Implementations§
Source§impl Clone for ComputableReal
impl Clone for ComputableReal
Source§fn clone(&self) -> ComputableReal
fn clone(&self) -> ComputableReal
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ComputableReal
impl !UnwindSafe for ComputableReal
impl Freeze for ComputableReal
impl Send for ComputableReal
impl Sync for ComputableReal
impl Unpin for ComputableReal
impl UnsafeUnpin for ComputableReal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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