Enum dashu_base::approx::Approximation
source · pub enum Approximation<T, E> {
Exact(T),
Inexact(T, E),
}
Expand description
Represent an calculation result with a possible error.
Variants§
Exact(T)
The result is exact, contains the result value
Inexact(T, E)
The result is inexact, contains the result value and error
Implementations§
source§impl<T, E> Approximation<T, E>
impl<T, E> Approximation<T, E>
pub fn error(&self) -> Option<&E>
pub fn map<U, F>(self, f: F) -> Approximation<U, E>where
F: FnOnce(T) -> U,
pub fn and_then<U, F>(self, f: F) -> Approximation<U, E>where
F: FnOnce(T) -> Approximation<U, E>,
Trait Implementations§
source§impl<T: Clone, E: Clone> Clone for Approximation<T, E>
impl<T: Clone, E: Clone> Clone for Approximation<T, E>
source§fn clone(&self) -> Approximation<T, E>
fn clone(&self) -> Approximation<T, E>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more