pub struct Tower<T> { /* private fields */ }Expand description
The radicals adjoined so far.
Implementations§
Source§impl<T: Arith> Tower<T>
impl<T: Arith> Tower<T>
Sourcepub fn from_f64(&self, value: f64) -> Nested<T>
pub fn from_f64(&self, value: f64) -> Nested<T>
The value of a finite f64 (see Arith::from_f64).
Sourcepub fn sqrt(&mut self, radicand: &Nested<T>) -> Result<Nested<T>, ExactError>
pub fn sqrt(&mut self, radicand: &Nested<T>) -> Result<Nested<T>, ExactError>
Adjoin sqrt(radicand) and return it as a value.
The radicand must not be negative. That is not checked here, since
the interval tier may be unable to tell; Tower::sign of any
value involving a negative radicand returns None, which the exact
tier reports as ExactError::Undefined.
§Errors
ExactError::TooDeep beyond MAX_DEPTH radicals.
§Panics
If radicand came from a different tower (its level exceeds this
tower’s depth).
Sourcepub fn sign(&self, x: &Nested<T>) -> Option<Sign>
pub fn sign(&self, x: &Nested<T>) -> Option<Sign>
The sign of x, or None when T cannot decide or a radicand
involved is negative.
Approximate arithmetics first evaluate x numerically through
Arith::sqrt_enclosure; that decides whenever x is visibly away
from zero. Otherwise, and always for exact arithmetics, signs are
decided by case analysis on the coefficients.