Trait Float

Source
pub trait Float: Num {
    const PI: Self;

    // Required methods
    fn signum(self) -> Self;
    fn floor(self) -> Self;
    fn ceil(self) -> Self;
    fn sqrt(self) -> Self;
    fn tan(self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn sin_cos(self) -> (Self, Self);
    fn atan2(y: Self, x: Self) -> Self;
    fn is_finite(self) -> bool;
    fn as_f32(self) -> f32;
}

Required Associated Constants§

Source

const PI: Self

Required Methods§

Source

fn signum(self) -> Self

Source

fn floor(self) -> Self

Source

fn ceil(self) -> Self

Source

fn sqrt(self) -> Self

Source

fn tan(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn sin_cos(self) -> (Self, Self)

Source

fn atan2(y: Self, x: Self) -> Self

Source

fn is_finite(self) -> bool

Source

fn as_f32(self) -> f32

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§

const PI: f32 = 3.14159274f32

Source§

fn signum(self) -> f32

Source§

fn floor(self) -> f32

Source§

fn ceil(self) -> f32

Source§

fn sqrt(self) -> f32

Source§

fn tan(self) -> f32

Source§

fn sin(self) -> f32

Source§

fn cos(self) -> f32

Source§

fn sin_cos(self) -> (f32, f32)

Source§

fn atan2(y: f32, x: f32) -> f32

Source§

fn is_finite(self) -> bool

Source§

fn as_f32(self) -> f32

Source§

impl Float for f64

Source§

const PI: f64 = 3.1415926535897931f64

Source§

fn signum(self) -> f64

Source§

fn floor(self) -> f64

Source§

fn ceil(self) -> f64

Source§

fn sqrt(self) -> f64

Source§

fn tan(self) -> f64

Source§

fn sin(self) -> f64

Source§

fn cos(self) -> f64

Source§

fn sin_cos(self) -> (f64, f64)

Source§

fn atan2(y: f64, x: f64) -> f64

Source§

fn is_finite(self) -> bool

Source§

fn as_f32(self) -> f32

Implementors§

Source§

impl<T> Float for T
where T: Real,

Source§

const PI: T = <Self as Real>::PI