Trait FloatExt

Source
pub trait FloatExt: Float {
    const NEG_HALF: Self;

    // Required methods
    fn hash_bits<H: Hasher>(self, hasher: &mut H);
    fn rem_euclid(self, rhs: Self) -> Self;
    fn next_up(self) -> Self;
    fn next_down(self) -> Self;
}
Expand description

Floating point types

Required Associated Constants§

Source

const NEG_HALF: Self

-0.5

Required Methods§

Source

fn hash_bits<H: Hasher>(self, hasher: &mut H)

Hash the binary representation of the floating point value

Source

fn rem_euclid(self, rhs: Self) -> Self

Calculates the least nonnegative remainder of self (mod rhs).

Source

fn next_up(self) -> Self

Returns the least number greater than self.

Source

fn next_down(self) -> Self

Returns the greatest number less than self.

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 FloatExt for f32

Source§

const NEG_HALF: Self = -0.5f32

Source§

fn hash_bits<H: Hasher>(self, hasher: &mut H)

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn next_down(self) -> Self

Source§

impl FloatExt for f64

Source§

const NEG_HALF: Self = -0.5f64

Source§

fn hash_bits<H: Hasher>(self, hasher: &mut H)

Source§

fn rem_euclid(self, rhs: Self) -> Self

Source§

fn next_up(self) -> Self

Source§

fn next_down(self) -> Self

Implementors§