Skip to main content

Real

Trait Real 

Source
pub trait Real: Number + PartialOrd {
    const MAX: Self;
    const MIN: Self;

    // Required methods
    fn max(l: Self, r: Self) -> Self;
    fn min(l: Self, r: Self) -> Self;
    fn rem(self, other: Self) -> Self;
    fn round(self) -> Self;
}
Expand description

A real-valued Number

Required Associated Constants§

Source

const MAX: Self

The maximum value of this data type.

Source

const MIN: Self

The minimum value of this data type.

Required Methods§

Source

fn max(l: Self, r: Self) -> Self

Return the maximum of the given values.

Source

fn min(l: Self, r: Self) -> Self

Return the maximum of the given values.

Source

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

Compute the remainder of self.div(other).

Source

fn round(self) -> Self

Round this value to the nearest integer.

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

Source§

const MAX: Self = f32::MAX

Source§

const MIN: Self = f32::MIN

Source§

fn max(l: Self, r: Self) -> f32

Source§

fn min(l: Self, r: Self) -> f32

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for f64

Source§

const MAX: Self = f64::MAX

Source§

const MIN: Self = f64::MIN

Source§

fn max(l: Self, r: Self) -> f64

Source§

fn min(l: Self, r: Self) -> f64

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for i8

Source§

const MAX: Self = i8::MAX

Source§

const MIN: Self = i8::MIN

Source§

fn max(l: Self, r: Self) -> i8

Source§

fn min(l: Self, r: Self) -> i8

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for i16

Source§

const MAX: Self = i16::MAX

Source§

const MIN: Self = i16::MIN

Source§

fn max(l: Self, r: Self) -> i16

Source§

fn min(l: Self, r: Self) -> i16

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for i32

Source§

const MAX: Self = i32::MAX

Source§

const MIN: Self = i32::MIN

Source§

fn max(l: Self, r: Self) -> i32

Source§

fn min(l: Self, r: Self) -> i32

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for i64

Source§

const MAX: Self = i64::MAX

Source§

const MIN: Self = i64::MIN

Source§

fn max(l: Self, r: Self) -> i64

Source§

fn min(l: Self, r: Self) -> i64

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for u8

Source§

const MAX: Self = u8::MAX

Source§

const MIN: Self = u8::MIN

Source§

fn max(l: Self, r: Self) -> u8

Source§

fn min(l: Self, r: Self) -> u8

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for u16

Source§

const MAX: Self = u16::MAX

Source§

const MIN: Self = u16::MIN

Source§

fn max(l: Self, r: Self) -> u16

Source§

fn min(l: Self, r: Self) -> u16

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for u32

Source§

const MAX: Self = u32::MAX

Source§

const MIN: Self = u32::MIN

Source§

fn max(l: Self, r: Self) -> u32

Source§

fn min(l: Self, r: Self) -> u32

Source§

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

Source§

fn round(self) -> Self

Source§

impl Real for u64

Source§

const MAX: Self = u64::MAX

Source§

const MIN: Self = u64::MIN

Source§

fn max(l: Self, r: Self) -> u64

Source§

fn min(l: Self, r: Self) -> u64

Source§

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

Source§

fn round(self) -> Self

Implementors§