round-to
Round floating point to integer.
Usage
You can round to i32 and i64 explicitly:
use *;
assert_eq!;
assert_eq!;
or implicitly to i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, or usize:
use *;
let a: i8 = 0.4.round_to;
assert_eq!;
using these modes:
use *;
assert_eq!;
assert_eq!;
assert_eq!;
Implementation
As of now, everything is implemented using round, floor, and ceil.
When round_ties_even is resolved, this crate will elect to use it instead.
In the future, optimized implementations may be added.