pub struct Interval { /* private fields */ }Expand description
A closed real interval [lo, hi] with Float endpoints.
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn new(lo: Float, hi: Float, precision: u64) -> Interval
pub fn new(lo: Float, hi: Float, precision: u64) -> Interval
Builds [lo, hi] at the given working precision. The endpoints are used
as given (assumed already correctly rounded outward).
Sourcepub fn from_rational(r: &Rational, precision: u64) -> Interval
pub fn from_rational(r: &Rational, precision: u64) -> Interval
Builds the tightest interval enclosing a rational at precision bits.
Sourcepub fn contains_zero(&self) -> bool
pub fn contains_zero(&self) -> bool
Returns true if the interval contains zero.
Trait Implementations§
Source§impl AddAssign for Interval
impl AddAssign for Interval
Source§fn add_assign(&mut self, rhs: Interval)
fn add_assign(&mut self, rhs: Interval)
Performs the
+= operation. Read moreSource§impl DivAssign for Interval
impl DivAssign for Interval
Source§fn div_assign(&mut self, rhs: Interval)
fn div_assign(&mut self, rhs: Interval)
Performs the
/= operation. Read moreSource§impl MulAssign for Interval
impl MulAssign for Interval
Source§fn mul_assign(&mut self, rhs: Interval)
fn mul_assign(&mut self, rhs: Interval)
Performs the
*= operation. Read moreAuto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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