pub trait TruncateSaturateInto<T> {
    // Required method
    fn truncate_saturate_into(self) -> T;
}
Expand description

Convert one type to another by rounding to the nearest integer towards zero.

Note

This has saturating semantics for when the integer cannot represent the float.

Returns

  • 0 when the input is NaN.
  • int::MIN when the input is -INF.
  • int::MAX when the input is +INF.

Required Methods§

source

fn truncate_saturate_into(self) -> T

Convert one type to another by rounding to the nearest integer towards zero.

Implementations on Foreign Types§

source§

impl TruncateSaturateInto<i32> for f64

source§

impl TruncateSaturateInto<i64> for f32

source§

impl TruncateSaturateInto<u32> for f64

source§

impl TruncateSaturateInto<i32> for f32

source§

impl TruncateSaturateInto<u64> for f64

source§

impl TruncateSaturateInto<u32> for f32

source§

impl TruncateSaturateInto<u64> for f32

source§

impl TruncateSaturateInto<i64> for f64

Implementors§