Trait BaseNum

Source
pub trait BaseNum:
    Primitive
    + Zero
    + One
    + Div<Self, Output = Self>
    + Rem<Self, Output = Self> {
    // Required methods
    fn min(self, other: Self) -> Self;
    fn max(self, other: Self) -> Self;
}
Expand description

Trait for primitive number type.

Required Methods§

Source

fn min(self, other: Self) -> Self

Returns the smaller one of two numbers.

§Example
use glm::BaseNum;
assert_eq!(1i32.min(2i32), 1i32);
Source

fn max(self, other: Self) -> Self

Returns the larger one of two numbers.

§Example
use glm::BaseNum;
assert_eq!(1i32.max(2i32), 2i32);

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 BaseNum for f32

Source§

fn min(self, other: f32) -> f32

Source§

fn max(self, other: f32) -> f32

Source§

impl BaseNum for f64

Source§

fn min(self, other: f64) -> f64

Source§

fn max(self, other: f64) -> f64

Source§

impl BaseNum for i32

Source§

fn min(self, other: i32) -> i32

Source§

fn max(self, other: i32) -> i32

Source§

impl BaseNum for u32

Source§

fn min(self, other: u32) -> u32

Source§

fn max(self, other: u32) -> u32

Implementors§