F64Polyfill

Trait F64Polyfill 

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

Polyfills for various std-only f64 methods.

Required Methods§

Source

fn abs(self) -> f64

Returns absolute value of self.

Source

fn acos(self) -> f64

Returns arc cosine of self.

Source

fn asin(self) -> f64

Returns arc sine of self.

Source

fn atan(self) -> f64

Returns arc tangent of self.

Source

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

Return arc tangent of self/other.

Source

fn ceil(self) -> f64

Returns the smallest integer greater than or equal to self.

Source

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

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

Source

fn cos(self) -> f64

Returns cosine of self.

Source

fn exp(self) -> f64

Returns e^(self).

Source

fn floor(self) -> f64

Returns the largest integer less than or equal to self.

Source

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

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) -> f64

Return natural logarithm of self.

Source

fn log2(self) -> f64

Returns base 2 logarithm of self.

Source

fn log10(self) -> f64

Returns base 10 logarithm of self.

Source

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

Returns (self * a) + b.

Source

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

Returns (self)^n.

Source

fn powi(self, n: i64) -> f64

Returns (self)^n.

Source

fn recip(self) -> f64

Returns 1/(self).

Source

fn round(self) -> f64

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

Source

fn sin(self) -> f64

Returns sine of self.

Source

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

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

Source

fn sqrt(self) -> f64

Returns square root of self.

Source

fn tan(self) -> f64

Returns tangent of self.

Source

fn trunc(self) -> f64

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 F64Polyfill for f64

Source§

fn abs(self) -> f64

Source§

fn acos(self) -> f64

Source§

fn asin(self) -> f64

Source§

fn atan(self) -> f64

Source§

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

Source§

fn ceil(self) -> f64

Source§

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

Source§

fn cos(self) -> f64

Source§

fn exp(self) -> f64

Source§

fn floor(self) -> f64

Source§

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

Source§

fn ln(self) -> f64

Source§

fn log2(self) -> f64

Source§

fn log10(self) -> f64

Source§

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

Source§

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

Source§

fn powi(self, n: i64) -> f64

Source§

fn recip(self) -> f64

Source§

fn round(self) -> f64

Source§

fn sin(self) -> f64

Source§

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

Source§

fn sqrt(self) -> f64

Source§

fn tan(self) -> f64

Source§

fn trunc(self) -> f64

Implementors§