pub trait ConvFloat<T>: Sized {
// Required methods
fn try_conv_trunc(x: T) -> Result<Self>;
fn try_conv_nearest(x: T) -> Result<Self>;
fn try_conv_floor(x: T) -> Result<Self>;
fn try_conv_ceil(x: T) -> Result<Self>;
// Provided methods
fn conv_trunc(x: T) -> Self { ... }
fn conv_nearest(x: T) -> Self { ... }
fn conv_floor(x: T) -> Self { ... }
fn conv_ceil(x: T) -> Self { ... }
}
std
or libm
only.Expand description
Nearest / floor / ceiling conversions from floating point types
This trait is explicitly for conversions from floating-point values to integers, supporting four rounding modes.
As with Conv
, the try_conv_*
methods must be implemented and must fail
if conversion to the expected value is not possible. If the source is non-
finite (inf
or NaN
), then Error::Range
should be returned.
The conv_*
methods each have a default implementation over the try_..
variant which panics on failure. Implementations handle errors as follows:
- In debug builds, the methods must panic
- Otherwise, the method may panic or may return a different value; all results must be well-defined and safe.
- Implementations provided by this library will also panic if the
always_assert
orassert_float
feature flag is used.
The sister-trait CastFloat
supports “into” style usage.
Required Methods§
Sourcefn try_conv_trunc(x: T) -> Result<Self>
fn try_conv_trunc(x: T) -> Result<Self>
Try converting to integer with truncation
Rounds towards zero (same as as
).
Sourcefn try_conv_nearest(x: T) -> Result<Self>
fn try_conv_nearest(x: T) -> Result<Self>
Try converting to the nearest integer
Half-way cases are rounded away from 0
.
Sourcefn try_conv_floor(x: T) -> Result<Self>
fn try_conv_floor(x: T) -> Result<Self>
Try converting the floor to an integer
Returns the largest integer less than or equal to x
.
Sourcefn try_conv_ceil(x: T) -> Result<Self>
fn try_conv_ceil(x: T) -> Result<Self>
Try convert the ceiling to an integer
Returns the smallest integer greater than or equal to x
.
Provided Methods§
Sourcefn conv_trunc(x: T) -> Self
fn conv_trunc(x: T) -> Self
Convert to integer with truncatation
Rounds towards zero (same as as
).
Sourcefn conv_nearest(x: T) -> Self
fn conv_nearest(x: T) -> Self
Convert to the nearest integer
Half-way cases are rounded away from 0
.
Sourcefn conv_floor(x: T) -> Self
fn conv_floor(x: T) -> Self
Convert the floor to an integer
Returns the largest integer less than or equal to x
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ConvFloat<f32> for i8
impl ConvFloat<f32> for i8
Source§fn conv_trunc(x: f32) -> i8
fn conv_trunc(x: f32) -> i8
std
or libm
only.Source§fn conv_nearest(x: f32) -> i8
fn conv_nearest(x: f32) -> i8
std
or libm
only.Source§fn conv_floor(x: f32) -> i8
fn conv_floor(x: f32) -> i8
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for i16
impl ConvFloat<f32> for i16
Source§fn conv_trunc(x: f32) -> i16
fn conv_trunc(x: f32) -> i16
std
or libm
only.Source§fn conv_nearest(x: f32) -> i16
fn conv_nearest(x: f32) -> i16
std
or libm
only.Source§fn conv_floor(x: f32) -> i16
fn conv_floor(x: f32) -> i16
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for i32
impl ConvFloat<f32> for i32
Source§fn conv_trunc(x: f32) -> i32
fn conv_trunc(x: f32) -> i32
std
or libm
only.Source§fn conv_nearest(x: f32) -> i32
fn conv_nearest(x: f32) -> i32
std
or libm
only.Source§fn conv_floor(x: f32) -> i32
fn conv_floor(x: f32) -> i32
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for i64
impl ConvFloat<f32> for i64
Source§fn conv_trunc(x: f32) -> i64
fn conv_trunc(x: f32) -> i64
std
or libm
only.Source§fn conv_nearest(x: f32) -> i64
fn conv_nearest(x: f32) -> i64
std
or libm
only.Source§fn conv_floor(x: f32) -> i64
fn conv_floor(x: f32) -> i64
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for i128
impl ConvFloat<f32> for i128
Source§fn conv_trunc(x: f32) -> i128
fn conv_trunc(x: f32) -> i128
std
or libm
only.Source§fn conv_nearest(x: f32) -> i128
fn conv_nearest(x: f32) -> i128
std
or libm
only.Source§fn conv_floor(x: f32) -> i128
fn conv_floor(x: f32) -> i128
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for isize
impl ConvFloat<f32> for isize
Source§fn conv_trunc(x: f32) -> isize
fn conv_trunc(x: f32) -> isize
std
or libm
only.Source§fn conv_nearest(x: f32) -> isize
fn conv_nearest(x: f32) -> isize
std
or libm
only.Source§fn conv_floor(x: f32) -> isize
fn conv_floor(x: f32) -> isize
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for u8
impl ConvFloat<f32> for u8
Source§fn conv_trunc(x: f32) -> u8
fn conv_trunc(x: f32) -> u8
std
or libm
only.Source§fn conv_nearest(x: f32) -> u8
fn conv_nearest(x: f32) -> u8
std
or libm
only.Source§fn conv_floor(x: f32) -> u8
fn conv_floor(x: f32) -> u8
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for u16
impl ConvFloat<f32> for u16
Source§fn conv_trunc(x: f32) -> u16
fn conv_trunc(x: f32) -> u16
std
or libm
only.Source§fn conv_nearest(x: f32) -> u16
fn conv_nearest(x: f32) -> u16
std
or libm
only.Source§fn conv_floor(x: f32) -> u16
fn conv_floor(x: f32) -> u16
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for u32
impl ConvFloat<f32> for u32
Source§fn conv_trunc(x: f32) -> u32
fn conv_trunc(x: f32) -> u32
std
or libm
only.Source§fn conv_nearest(x: f32) -> u32
fn conv_nearest(x: f32) -> u32
std
or libm
only.Source§fn conv_floor(x: f32) -> u32
fn conv_floor(x: f32) -> u32
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for u64
impl ConvFloat<f32> for u64
Source§fn conv_trunc(x: f32) -> u64
fn conv_trunc(x: f32) -> u64
std
or libm
only.Source§fn conv_nearest(x: f32) -> u64
fn conv_nearest(x: f32) -> u64
std
or libm
only.Source§fn conv_floor(x: f32) -> u64
fn conv_floor(x: f32) -> u64
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f32> for u128
impl ConvFloat<f32> for u128
fn conv_trunc(x: f32) -> u128
fn conv_nearest(x: f32) -> u128
fn conv_floor(x: f32) -> u128
fn conv_ceil(x: f32) -> u128
fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
Source§impl ConvFloat<f32> for usize
impl ConvFloat<f32> for usize
Source§fn conv_trunc(x: f32) -> usize
fn conv_trunc(x: f32) -> usize
std
or libm
only.Source§fn conv_nearest(x: f32) -> usize
fn conv_nearest(x: f32) -> usize
std
or libm
only.Source§fn conv_floor(x: f32) -> usize
fn conv_floor(x: f32) -> usize
std
or libm
only.Source§fn try_conv_trunc(x: f32) -> Result<Self>
fn try_conv_trunc(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f32) -> Result<Self>
fn try_conv_nearest(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f32) -> Result<Self>
fn try_conv_floor(x: f32) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f32) -> Result<Self>
fn try_conv_ceil(x: f32) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for i8
impl ConvFloat<f64> for i8
Source§fn conv_trunc(x: f64) -> i8
fn conv_trunc(x: f64) -> i8
std
or libm
only.Source§fn conv_nearest(x: f64) -> i8
fn conv_nearest(x: f64) -> i8
std
or libm
only.Source§fn conv_floor(x: f64) -> i8
fn conv_floor(x: f64) -> i8
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for i16
impl ConvFloat<f64> for i16
Source§fn conv_trunc(x: f64) -> i16
fn conv_trunc(x: f64) -> i16
std
or libm
only.Source§fn conv_nearest(x: f64) -> i16
fn conv_nearest(x: f64) -> i16
std
or libm
only.Source§fn conv_floor(x: f64) -> i16
fn conv_floor(x: f64) -> i16
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for i32
impl ConvFloat<f64> for i32
Source§fn conv_trunc(x: f64) -> i32
fn conv_trunc(x: f64) -> i32
std
or libm
only.Source§fn conv_nearest(x: f64) -> i32
fn conv_nearest(x: f64) -> i32
std
or libm
only.Source§fn conv_floor(x: f64) -> i32
fn conv_floor(x: f64) -> i32
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for i64
impl ConvFloat<f64> for i64
Source§fn conv_trunc(x: f64) -> i64
fn conv_trunc(x: f64) -> i64
std
or libm
only.Source§fn conv_nearest(x: f64) -> i64
fn conv_nearest(x: f64) -> i64
std
or libm
only.Source§fn conv_floor(x: f64) -> i64
fn conv_floor(x: f64) -> i64
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for i128
impl ConvFloat<f64> for i128
Source§fn conv_trunc(x: f64) -> i128
fn conv_trunc(x: f64) -> i128
std
or libm
only.Source§fn conv_nearest(x: f64) -> i128
fn conv_nearest(x: f64) -> i128
std
or libm
only.Source§fn conv_floor(x: f64) -> i128
fn conv_floor(x: f64) -> i128
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for isize
impl ConvFloat<f64> for isize
Source§fn conv_trunc(x: f64) -> isize
fn conv_trunc(x: f64) -> isize
std
or libm
only.Source§fn conv_nearest(x: f64) -> isize
fn conv_nearest(x: f64) -> isize
std
or libm
only.Source§fn conv_floor(x: f64) -> isize
fn conv_floor(x: f64) -> isize
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for u8
impl ConvFloat<f64> for u8
Source§fn conv_trunc(x: f64) -> u8
fn conv_trunc(x: f64) -> u8
std
or libm
only.Source§fn conv_nearest(x: f64) -> u8
fn conv_nearest(x: f64) -> u8
std
or libm
only.Source§fn conv_floor(x: f64) -> u8
fn conv_floor(x: f64) -> u8
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for u16
impl ConvFloat<f64> for u16
Source§fn conv_trunc(x: f64) -> u16
fn conv_trunc(x: f64) -> u16
std
or libm
only.Source§fn conv_nearest(x: f64) -> u16
fn conv_nearest(x: f64) -> u16
std
or libm
only.Source§fn conv_floor(x: f64) -> u16
fn conv_floor(x: f64) -> u16
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for u32
impl ConvFloat<f64> for u32
Source§fn conv_trunc(x: f64) -> u32
fn conv_trunc(x: f64) -> u32
std
or libm
only.Source§fn conv_nearest(x: f64) -> u32
fn conv_nearest(x: f64) -> u32
std
or libm
only.Source§fn conv_floor(x: f64) -> u32
fn conv_floor(x: f64) -> u32
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for u64
impl ConvFloat<f64> for u64
Source§fn conv_trunc(x: f64) -> u64
fn conv_trunc(x: f64) -> u64
std
or libm
only.Source§fn conv_nearest(x: f64) -> u64
fn conv_nearest(x: f64) -> u64
std
or libm
only.Source§fn conv_floor(x: f64) -> u64
fn conv_floor(x: f64) -> u64
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for u128
impl ConvFloat<f64> for u128
Source§fn conv_trunc(x: f64) -> u128
fn conv_trunc(x: f64) -> u128
std
or libm
only.Source§fn conv_nearest(x: f64) -> u128
fn conv_nearest(x: f64) -> u128
std
or libm
only.Source§fn conv_floor(x: f64) -> u128
fn conv_floor(x: f64) -> u128
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.Source§impl ConvFloat<f64> for usize
impl ConvFloat<f64> for usize
Source§fn conv_trunc(x: f64) -> usize
fn conv_trunc(x: f64) -> usize
std
or libm
only.Source§fn conv_nearest(x: f64) -> usize
fn conv_nearest(x: f64) -> usize
std
or libm
only.Source§fn conv_floor(x: f64) -> usize
fn conv_floor(x: f64) -> usize
std
or libm
only.Source§fn try_conv_trunc(x: f64) -> Result<Self>
fn try_conv_trunc(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_nearest(x: f64) -> Result<Self>
fn try_conv_nearest(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_floor(x: f64) -> Result<Self>
fn try_conv_floor(x: f64) -> Result<Self>
std
or libm
only.Source§fn try_conv_ceil(x: f64) -> Result<Self>
fn try_conv_ceil(x: f64) -> Result<Self>
std
or libm
only.