#[non_exhaustive]pub enum RoundingMode {
Ceil,
Floor,
Expand,
Trunc,
HalfCeil,
HalfFloor,
HalfExpand,
HalfTrunc,
HalfEven,
}Expand description
roundingMode (ECMA-402’s names and meanings).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ceil
ceil: towards +∞.
Floor
floor: towards −∞.
Expand
expand: away from 0.
Trunc
trunc: towards 0.
HalfCeil
halfCeil: to the nearest, ties towards +∞.
HalfFloor
halfFloor: to the nearest, ties towards −∞.
HalfExpand
halfExpand (the default): to the nearest, ties away from 0.
HalfTrunc
halfTrunc: to the nearest, ties towards 0.
HalfEven
halfEven: to the nearest, ties to even.
Trait Implementations§
Source§impl Clone for RoundingMode
impl Clone for RoundingMode
impl Copy for RoundingMode
Source§impl Debug for RoundingMode
impl Debug for RoundingMode
impl Eq for RoundingMode
Source§impl Hash for RoundingMode
impl Hash for RoundingMode
Source§impl PartialEq for RoundingMode
impl PartialEq 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