Skip to main content

Scalar

Trait Scalar 

pub trait Scalar: Copy {
    const ZERO: Self;
    const NEARLY_ZERO: Self;
    const ONE: Self;
    const HALF: Self;

    // Required methods
    fn nearly_equal(x: f32, y: f32, tolerance: impl Into<Option<f32>>) -> bool;
    fn nearly_zero(&self, tolerance: impl Into<Option<f32>>) -> bool;
}

Required Associated Constants§

const ZERO: Self

const NEARLY_ZERO: Self

const ONE: Self

const HALF: Self

Required Methods§

fn nearly_equal(x: f32, y: f32, tolerance: impl Into<Option<f32>>) -> bool

fn nearly_zero(&self, tolerance: impl Into<Option<f32>>) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl Scalar for f32

§

const ZERO: f32 = 0.0

§

const NEARLY_ZERO: f32

§

const ONE: f32 = 1.0

§

const HALF: f32 = 0.5

§

fn nearly_equal(x: f32, y: f32, tolerance: impl Into<Option<f32>>) -> bool

§

fn nearly_zero(&self, tolerance: impl Into<Option<f32>>) -> bool

Implementors§