Trait std::num::Round
pub trait Round { fn floor(&self) -> Self; fn ceil(&self) -> Self; fn round(&self) -> Self; fn trunc(&self) -> Self; fn fract(&self) -> Self; }
A collection of rounding operations.
Required Methods
fn floor(&self) -> Self
Return the largest integer less than or equal to a number.
fn ceil(&self) -> Self
Return the smallest integer greater than or equal to a number.
fn round(&self) -> Self
Return the nearest integer to a number. Round half-way cases away from
0.0
.
fn trunc(&self) -> Self
Return the integer part of a number.
fn fract(&self) -> Self
Return the fractional part of a number.