Enum reckoner::RoundMode [−][src]
pub enum RoundMode { Down, Up, HalfUp, HalfDown, }
as a decimal value. There are four rounding modes currently supported.
Variants
Truncates the value toward zero.
For example, 12.009 to 2 decimal places becomes 12.00.
Rounds the value away from zero.
For example, 12.001 to 2 decimal places becomes 12.01, but 12.000 to 2 decimal places remains 12.00.
Rounds the value to nearest digit, half rounds upward.
For example, 12.005 to 2 decimal places becomes 12.01, but 12.004 to 2 decimal places becomes 12.00.
Rounds the value to nearest digit, half goes toward zero.
For example, 12.005 to 2 decimal places becomes 12.00, but 12.006 to 2 decimal places becomes 12.01.
Trait Implementations
impl Into<u32> for RoundMode
[src]
fn into(self) -> mp_round_mode
[src]
impl TryFrom<u32> for RoundMode
[src]
Auto Trait Implementations
impl RefUnwindSafe for RoundMode
impl Send for RoundMode
impl Sync for RoundMode
impl Unpin for RoundMode
impl UnwindSafe for RoundMode
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,