Skip to main content

Rational

Trait Rational 

Source
pub trait Rational {
    // Required methods
    fn floor(self) -> Self;
    fn ceil(self) -> Self;
    fn trunc(self) -> Self;
    fn fract(self) -> Self;
}
Expand description

Some additional methods for fractional parts of numbers

Required Methods§

Source

fn floor(self) -> Self

Source

fn ceil(self) -> Self

Source

fn trunc(self) -> Self

Source

fn fract(self) -> Self

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

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl Rational for f64

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl<U> Rational for FixedI8<U>
where U: Unsigned + LtU8,

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl<U> Rational for FixedI16<U>
where U: Unsigned + LtU16,

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl<U> Rational for FixedI32<U>
where U: Unsigned + LtU32,

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Source§

impl<U> Rational for FixedI64<U>
where U: Unsigned + LtU64,

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

fn trunc(self) -> Self

Source§

fn fract(self) -> Self

Implementors§