Skip to main content

Floor

Struct Floor 

Source
pub struct Floor;
Available on crate features libm or std only.
Expand description

Round towards negative infinity (floor)

Returns the largest integer less than or equal to the input.

Example: 2.9_f32 converts to 2_i32, -2.1_f32 converts to -3_i32.

The § Limits of approximation as specified by Approx apply.

Trait Implementations§

Source§

impl Clone for Floor

Source§

fn clone(&self) -> Floor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S, T: ConvExact<S>> ConvTo<S, Floor> for T

Source§

type Error = <T as ConvExact<S>>::Error

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, s: S) -> Result<Self, Self::Error>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, s: S) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for i8

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for i16

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for i32

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for i64

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for i128

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for isize

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for u8

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for u16

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for u32

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for u64

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for usize

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f32, Floor> for u128

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f32) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f32) -> u128

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for i8

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for i16

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for i32

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for i64

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for i128

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for isize

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for u8

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for u16

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for u32

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for u64

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for u128

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl ConvTo<f64, Floor> for usize

Source§

type Error = RangeError

Conversion error type Read more
Source§

fn try_conv_to(_: Floor, x: f64) -> Result<Self, RangeError>

Try converting from S to Self, rounding according to mode
Source§

fn conv_to(_: Floor, x: f64) -> Self

Convert from S to Self, rounding according to mode Read more
Source§

impl Copy for Floor

Source§

impl Debug for Floor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Floor

Source§

fn default() -> Floor

Returns the “default value” for a type. Read more
Source§

impl Rounding for Floor

Source§

type MaximumError = RangeError

Maximum error type

Auto Trait Implementations§

§

impl Freeze for Floor

§

impl RefUnwindSafe for Floor

§

impl Send for Floor

§

impl Sync for Floor

§

impl Unpin for Floor

§

impl UnsafeUnpin for Floor

§

impl UnwindSafe for Floor

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Cast<T> for S
where T: Conv<S>,

Source§

type Error = <T as Conv<S>>::Error

Conversion error type Read more
Source§

fn cast(self) -> T

Cast from Self to T Read more
Source§

fn try_cast(self) -> Result<T, <S as Cast<T>>::Error>

Try converting from Self to T
Source§

impl<S, T> CastApprox<T> for S
where T: ConvApprox<S>,

Source§

type Error = <T as ConvApprox<S>>::Error

Conversion error type Read more
Source§

fn try_cast_approx(self) -> Result<T, <S as CastApprox<T>>::Error>

Try approximate conversion from Self to T
Source§

fn cast_approx(self) -> T

Cast approximately from Self to T Read more
Source§

impl<R, S, T> CastTo<T, R> for S
where R: Rounding, T: ConvTo<S, R>,

Source§

type Error = <T as ConvTo<S, R>>::Error

Conversion error type Read more
Source§

fn try_cast_to(self, mode: R) -> Result<T, <S as CastTo<T, R>>::Error>

Try converting from Self to T, rounding according to mode
Source§

fn cast_to(self, mode: R) -> T

Convert from Self to T, rounding according to mode Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.