palette::num

Trait Round

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

Methods for rounding numbers to integers.

Required Methods§

Source

fn round(self) -> Self

Return the nearest integer to self. Round half-way cases away from 0.0.

Source

fn floor(self) -> Self

Return the largest integer less than or equal to self.

Source

fn ceil(self) -> Self

Return the smallest integer greater than or equal to 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 Round for f32

Source§

fn round(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Source§

impl Round for f64

Source§

fn round(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn ceil(self) -> Self

Implementors§