Struct az::Round [−][src]
#[repr(transparent)]pub struct Round<T>(pub T);
Expand description
Used to convert floating-point numbers to integers with rounding to the nearest, with ties rounded to even.
The underlying value can be retrieved through the .0
index.
Examples
use az::Round;
assert_eq!(az::cast::<_, i32>(Round(0.4)), 0);
assert_eq!(az::cast::<_, i32>(Round(0.6)), 1);
// ties rounded to even
assert_eq!(az::cast::<_, i32>(Round(-0.5)), 0);
assert_eq!(az::cast::<_, i32>(Round(-1.5)), -2);
Tuple Fields
0: T
Trait Implementations
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Auto Trait Implementations
impl<T> RefUnwindSafe for Round<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Round<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.