F32Polyfill

Trait F32Polyfill 

Source
pub trait F32Polyfill: Sized {
Show 24 methods // Required methods fn abs(self) -> f32; fn acos(self) -> f32; fn asin(self) -> f32; fn atan(self) -> f32; fn atan2(self, other: f32) -> f32; fn ceil(self) -> f32; fn copysign(self, sign: f32) -> f32; fn cos(self) -> f32; fn exp(self) -> f32; fn floor(self) -> f32; fn hypot(self, other: f32) -> f32; fn ln(self) -> f32; fn log2(self) -> f32; fn log10(self) -> f32; fn mul_add(self, a: f32, b: f32) -> f32; fn powf(self, n: f32) -> f32; fn powi(self, n: i32) -> f32; fn recip(self) -> f32; fn round(self) -> f32; fn sin(self) -> f32; fn sin_cos(self) -> (f32, f32); fn sqrt(self) -> f32; fn tan(self) -> f32; fn trunc(self) -> f32;
}
Expand description

Polyfills for various std-only f32 methods.

Required Methods§

Source

fn abs(self) -> f32

Returns absolute value of self.

Source

fn acos(self) -> f32

Returns arc cosine of self.

Source

fn asin(self) -> f32

Returns arc sine of self.

Source

fn atan(self) -> f32

Returns arc tangent of self.

Source

fn atan2(self, other: f32) -> f32

Return arc tangent of self/other.

Source

fn ceil(self) -> f32

Returns the smallest integer greater than or equal to self.

Source

fn copysign(self, sign: f32) -> f32

Returns a number with magnitude of self and sign of sign.

Source

fn cos(self) -> f32

Returns cosine of self.

Source

fn exp(self) -> f32

Returns e^(self).

Source

fn floor(self) -> f32

Returns the largest integer less than or equal to self.

Source

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

Compute the distance between the origin and a point (self, other) on the Euclidean plane. Equivalently, compute the length of the hypotenuse of a right-angle triangle with other sides having length self.abs() and other.abs().

Source

fn ln(self) -> f32

Return natural logarithm of self.

Source

fn log2(self) -> f32

Returns base 2 logarithm of self.

Source

fn log10(self) -> f32

Returns base 10 logarithm of self.

Source

fn mul_add(self, a: f32, b: f32) -> f32

Returns (self * a) + b.

Source

fn powf(self, n: f32) -> f32

Returns (self)^n.

Source

fn powi(self, n: i32) -> f32

Returns (self)^n.

Source

fn recip(self) -> f32

Returns 1/(self).

Source

fn round(self) -> f32

Returns the nearest integer to self. If a value is half-way between two integers, round away from 0.0.

Source

fn sin(self) -> f32

Returns sine of self.

Source

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

Returns (sin(self), cos(self)).

Source

fn sqrt(self) -> f32

Returns square root of self.

Source

fn tan(self) -> f32

Returns tangent of self.

Source

fn trunc(self) -> f32

Returns the integer part of self. This means that non-integer numbers are always truncated 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 F32Polyfill for f32

Source§

fn abs(self) -> f32

Source§

fn acos(self) -> f32

Source§

fn asin(self) -> f32

Source§

fn atan(self) -> f32

Source§

fn atan2(self, other: f32) -> f32

Source§

fn ceil(self) -> f32

Source§

fn copysign(self, sign: f32) -> f32

Source§

fn cos(self) -> f32

Source§

fn exp(self) -> f32

Source§

fn floor(self) -> f32

Source§

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

Source§

fn ln(self) -> f32

Source§

fn log2(self) -> f32

Source§

fn log10(self) -> f32

Source§

fn mul_add(self, a: f32, b: f32) -> f32

Source§

fn powf(self, n: f32) -> f32

Source§

fn powi(self, n: i32) -> f32

Source§

fn recip(self) -> f32

Source§

fn round(self) -> f32

Source§

fn sin(self) -> f32

Source§

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

Source§

fn sqrt(self) -> f32

Source§

fn tan(self) -> f32

Source§

fn trunc(self) -> f32

Implementors§