#[repr(i32)]pub enum RoundingMode {
ToNearest = 0,
TowardsZero = 1,
Downward = 2,
Upward = 3,
}Expand description
Rounding mode for float operations, matching rippled’s Number::RoundingMode.
The host functions take the mode as an i32; convert with .into() at the call site.
Variants§
ToNearest = 0
Round to the nearest representable value.
TowardsZero = 1
Round toward zero (truncate).
Downward = 2
Round toward negative infinity.
Upward = 3
Round toward positive infinity.
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 moreimpl Copy for RoundingMode
Source§impl Debug for RoundingMode
impl Debug for RoundingMode
impl Eq for RoundingMode
Source§impl From<RoundingMode> for i32
impl From<RoundingMode> for i32
Source§fn from(mode: RoundingMode) -> Self
fn from(mode: RoundingMode) -> Self
Converts to this type from the input type.
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§
§impl<T> AnySync for T
impl<T> AnySync for T
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