Skip to main content

Float

Trait Float 

Source
pub trait Float: Sized {
    // Required methods
    fn round(self) -> Self;
    fn floor(self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn hypot(self, other: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
}
Expand description

The f32 methods the frame and the game call that need std.

Required Methods§

Source

fn round(self) -> Self

Nearest integer, halves away from zero.

Source

fn floor(self) -> Self

Largest integer not above self.

Source

fn sin(self) -> Self

Sine, in radians.

Source

fn cos(self) -> Self

Cosine, in radians.

Source

fn hypot(self, other: Self) -> Self

sqrt(self² + other²) without overflow.

Source

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

The least non-negative remainder of self / rhs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Float for f32

Source§

fn round(self) -> Self

Source§

fn floor(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

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

Implementors§