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

Trait for approximating a number to the nearest integer

Required Methods§

source

fn floor(self) -> Self

Return the largest integer less than or equal to the number

source

fn ceil(self) -> Self

Return the smallest integer greater than or equal to the number

source

fn round(self) -> Self

Return the nearest integer to the number

Implementations on Foreign Types§

source§

impl Approx for i64

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for f64

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for i16

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for u32

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for usize

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for u64

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for i32

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for u8

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for u16

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for i128

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for u128

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for NotNan<f64>

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for f32

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for NotNan<f32>

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for isize

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

source§

impl Approx for i8

source§

fn floor(self) -> Self

source§

fn ceil(self) -> Self

source§

fn round(self) -> Self

Implementors§