mz_repr::adt::numeric

Trait DecimalLike

Source
pub trait DecimalLike:
    From<u8>
    + From<u16>
    + From<u32>
    + From<i8>
    + From<i16>
    + From<i32>
    + From<f32>
    + From<f64>
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self> {
    // Required method
    fn lossy_from(i: i64) -> Self;
}
Expand description

A type that can represent Real Numbers. Useful for interoperability between Numeric and floating point.

Required Methods§

Source

fn lossy_from(i: i64) -> Self

Used to do value-to-value conversions while consuming the input value. Depending on the implementation it may be potentially lossy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl DecimalLike for f64

Source§

fn lossy_from(i: i64) -> Self

Implementors§