Enum fpdec_core::RoundingMode
source · [−]pub enum RoundingMode {
Round05Up,
RoundCeiling,
RoundDown,
RoundFloor,
RoundHalfDown,
RoundHalfEven,
RoundHalfUp,
RoundUp,
}
Expand description
Enum representing the different methods used when rounding a number.
Variants
Round05Up
Round away from zero if last digit after rounding towards zero would have been 0 or 5; otherwise round towards zero.
RoundCeiling
Round towards Infinity.
RoundDown
Round towards zero.
RoundFloor
Round towards -Infinity.
RoundHalfDown
Round to nearest with ties going towards zero.
RoundHalfEven
Round to nearest with ties going to nearest even integer.
RoundHalfUp
Round to nearest with ties going away from zero.
RoundUp
Round away from zero.
Implementations
sourceimpl RoundingMode
impl RoundingMode
sourcepub fn set_default(mode: RoundingMode)
pub fn set_default(mode: RoundingMode)
Sets the default RoundingMode for the current thread.
Trait Implementations
sourceimpl Clone for RoundingMode
impl Clone for RoundingMode
sourcefn clone(&self) -> RoundingMode
fn clone(&self) -> RoundingMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RoundingMode
impl Debug for RoundingMode
sourceimpl Default for RoundingMode
impl Default for RoundingMode
sourcefn default() -> Self
fn default() -> Self
Returns the default RoundingMode set for the current thread.
It is initially set to RoundingMode::RoundHalfEven, but can be changed using the fn RoundingMode::set_default.
sourceimpl PartialEq<RoundingMode> for RoundingMode
impl PartialEq<RoundingMode> for RoundingMode
impl Copy for RoundingMode
impl StructuralPartialEq for RoundingMode
Auto Trait Implementations
impl RefUnwindSafe for RoundingMode
impl Send for RoundingMode
impl Sync for RoundingMode
impl Unpin for RoundingMode
impl UnwindSafe for RoundingMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more