Trait geng::prelude::UNum

pub trait UNum: Sized + Copy + Debug + Display + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + Mul<Output = Self> + MulAssign + Div<Output = Self> + DivAssign + PartialEq + PartialOrd + SampleUniform {
    const ZERO: Self;
    const ONE: Self;

    // Provided method
    fn sqr(self) -> Self { ... }
}
Expand description

Generic number, possibly unsigned

Required Associated Constants§

const ZERO: Self

Additive identity

const ONE: Self

Multiplicative identity

Provided Methods§

fn sqr(self) -> Self

Calculate squared value (self * self)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl UNum for f32

§

const ZERO: f32 = 0f32

§

const ONE: f32 = 1f32

§

impl UNum for f64

§

const ZERO: f64 = 0f64

§

const ONE: f64 = 1f64

§

impl UNum for i8

§

const ZERO: i8 = 0i8

§

const ONE: i8 = 1i8

§

impl UNum for i16

§

const ZERO: i16 = 0i16

§

const ONE: i16 = 1i16

§

impl UNum for i32

§

const ZERO: i32 = 0i32

§

const ONE: i32 = 1i32

§

impl UNum for i64

§

const ZERO: i64 = 0i64

§

const ONE: i64 = 1i64

§

impl UNum for isize

§

const ZERO: isize = 0isize

§

const ONE: isize = 1isize

§

impl UNum for u8

§

const ZERO: u8 = 0u8

§

const ONE: u8 = 1u8

§

impl UNum for u16

§

const ZERO: u16 = 0u16

§

const ONE: u16 = 1u16

§

impl UNum for u32

§

const ZERO: u32 = 0u32

§

const ONE: u32 = 1u32

§

impl UNum for u64

§

const ZERO: u64 = 0u64

§

const ONE: u64 = 1u64

§

impl UNum for usize

§

const ZERO: usize = 0usize

§

const ONE: usize = 1usize

Implementors§

§

impl<T> UNum for RealImpl<T>
where T: Float,

§

const ZERO: RealImpl<T> = _

§

const ONE: RealImpl<T> = _