Skip to main content

Float

Trait Float 

Source
pub trait Float: Scalar {
    // Required methods
    fn floor(self) -> Self;
    fn reciprocal(self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn sqrt(self) -> Self;
    fn trunc(self) -> Self;
}
Expand description

Float dtype

Required Methods§

Source

fn floor(self) -> Self

Round down

Source

fn reciprocal(self) -> Self

1/self

Source

fn sin(self) -> Self

Sin

Source

fn cos(self) -> Self

Cos

Source

fn sqrt(self) -> Self

Square root of this scalar.

Source

fn trunc(self) -> Self

Truncate towards zero

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

Source§

fn sin(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn reciprocal(self) -> Self

Source§

fn trunc(self) -> Self

Source§

impl Float for f64

Source§

fn reciprocal(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn trunc(self) -> Self

Source§

impl Float for bf16

Source§

fn reciprocal(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn trunc(self) -> Self

Source§

impl Float for f16

Source§

fn reciprocal(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn trunc(self) -> Self

Implementors§