Trait comlib_math::Numeric [−][src]
pub trait Numeric: Copy + Display + Debug + Add<Output = Self> + Sub<Output = Self> + Mul<Output = Self> + Div<Output = Self> + Rem<Output = Self> + AddAssign + SubAssign + MulAssign + DivAssign + RemAssign + PartialEq + PartialOrd + Default {
fn zero() -> Self;
fn one() -> Self;
fn from_int(value: i8) -> Self;
fn as_f64(self) -> f64;
fn is_zero(self) -> bool { ... }
fn is_one(self) -> bool { ... }
fn as_f32(self) -> f32 { ... }
}Expand description
Trait implemented by numeric types.
Required methods
Converts the given integer to the type.
This function implements best-effort conversion and may fail in unexpected ways for values unsuitable for the target data type.