pub enum RoundingMode {
Up,
Down,
Ceiling,
Floor,
HalfUp,
HalfDown,
HalfEven,
Unnecessary,
}Expand description
Rounding modes for arbitrary-precision arithmetic.
This enum is independent of any backend library and provides a common vocabulary for precision control across all OxiNum numeric types.
Variants§
Up
Round toward positive infinity.
Down
Round toward negative infinity.
Ceiling
Round toward positive infinity (alias for Up in unsigned context).
Floor
Round toward negative infinity (alias for Down in unsigned context).
HalfUp
Round half toward positive infinity.
HalfDown
Round half toward negative infinity.
HalfEven
Round half to the nearest even digit (banker’s rounding).
Unnecessary
Exact result required – error if rounding would occur.
Trait Implementations§
Source§impl Clone for RoundingMode
impl Clone for RoundingMode
Source§fn clone(&self) -> RoundingMode
fn clone(&self) -> RoundingMode
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 moreSource§impl Debug for RoundingMode
impl Debug for RoundingMode
Source§impl Display for RoundingMode
impl Display for RoundingMode
Source§impl Hash for RoundingMode
impl Hash for RoundingMode
Source§impl PartialEq for RoundingMode
impl PartialEq for RoundingMode
Source§fn eq(&self, other: &RoundingMode) -> bool
fn eq(&self, other: &RoundingMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for RoundingMode
impl Eq for RoundingMode
impl StructuralPartialEq for RoundingMode
Auto Trait Implementations§
impl Freeze for RoundingMode
impl RefUnwindSafe for RoundingMode
impl Send for RoundingMode
impl Sync for RoundingMode
impl Unpin for RoundingMode
impl UnsafeUnpin for RoundingMode
impl UnwindSafe for RoundingMode
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