pub struct Trunc;Expand description
Truncation towards zero
Excess precision is truncated (rounds towards zero). This is the rounding
mode used by as numeric casts for floating-point to integer conversions.
Example: 2.9_f32 converts to 2_i32, -2.9_f32 converts to -2_i32.
The § Limits of approximation as
specified by Approx apply.
Trait Implementations§
Source§impl<S, T: ConvExact<S>> ConvTo<S, Trunc> for T
Available on crate features libm or std only.
impl<S, T: ConvExact<S>> ConvTo<S, Trunc> for T
Available on crate features
libm or std only.impl Copy for Trunc
Source§impl Rounding for Trunc
impl Rounding for Trunc
Source§type MaximumError = RangeError
type MaximumError = RangeError
Maximum error type
Auto Trait Implementations§
impl Freeze for Trunc
impl RefUnwindSafe for Trunc
impl Send for Trunc
impl Sync for Trunc
impl Unpin for Trunc
impl UnsafeUnpin for Trunc
impl UnwindSafe for Trunc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, <S as CastApprox<T>>::Error>
fn try_cast_approx(self) -> Result<T, <S as CastApprox<T>>::Error>
Try approximate conversion from
Self to T