Trait Numeric

pub trait Numeric:
    Sized
    + Debug
    + Copy
    + PartialEq
    + Neg<Output = Self>
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<f64, Output = Self>
    + Div<f64, Output = Self> {
    // Required methods
    fn zero() -> Self;
    fn is_finite(self) -> bool;

    // Provided method
    fn is_zero(self) -> bool { ... }
}
Expand description

A numeric type.

Required Methods§

fn zero() -> Self

The identity element for addition.

fn is_finite(self) -> bool

Whether self consists only of finite parts.

Provided Methods§

fn is_zero(self) -> bool

Whether self is zero.

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§

§

impl Numeric for Abs

§

fn zero() -> Abs

§

fn is_finite(self) -> bool

§

impl Numeric for Angle

§

fn zero() -> Angle

§

fn is_finite(self) -> bool

§

impl Numeric for Axes<Abs>

§

fn zero() -> Axes<Abs>

§

fn is_finite(self) -> bool

§

impl Numeric for Em

§

fn zero() -> Em

§

fn is_finite(self) -> bool

§

impl Numeric for Fr

§

fn zero() -> Fr

§

fn is_finite(self) -> bool

§

impl Numeric for Length

§

fn zero() -> Length

§

fn is_finite(self) -> bool

§

impl Numeric for Point

§

fn zero() -> Point

§

fn is_finite(self) -> bool

Implementors§

§

impl Numeric for Scalar