Trait rustduino::math::F32Ext [−][src]
pub trait F32Ext {}Show 29 methods
fn abs(self) -> f32; fn acos(self) -> f32; fn asin(self) -> f32; fn atan(self) -> f32; fn atan_norm(self) -> f32; fn atan2(self, other: f32) -> f32; fn atan2_norm(self, other: f32) -> f32; fn ceil(self) -> f32; fn copysign(self, sign: f32) -> f32; fn cos(self) -> f32; fn div_euclid(self, other: f32) -> f32; fn exp(self) -> f32; fn floor(self) -> f32; fn fract(self) -> f32; fn hypot(self, other: f32) -> f32; fn inv(self) -> f32; fn invsqrt(self) -> f32; fn ln(self) -> f32; fn log(self, base: f32) -> f32; fn log2(self) -> f32; fn log10(self) -> f32; fn powf(self, n: f32) -> f32; fn powi(self, n: i32) -> f32; fn rem_euclid(self, other: f32) -> f32; fn round(self) -> f32; fn sin(self) -> f32; fn sqrt(self) -> f32; fn tan(self) -> f32; fn trunc(self) -> f32;
Expand description
f32
extension providing various arithmetic approximations and polyfills
for std
functionality.
Required methods
Compute absolute value with a constant-time, data-independent implementation.
Approximates atan(x)
normalized to the [−1,1]
range with a maximum
error of 0.1620
degrees.
Approximates the four quadrant arctangent atan2(x)
in radians, with
a maximum error of 0.002
.
fn atan2_norm(self, other: f32) -> f32
fn atan2_norm(self, other: f32) -> f32
Approximates the four quadrant arctangent.
Normalized to the [0,4)
range with a maximum error of 0.1620
degrees.
fn div_euclid(self, other: f32) -> f32
fn div_euclid(self, other: f32) -> f32
Calculates Euclidean division, the matching method for rem_euclid
.
Approximates the length of the hypotenuse of a right-angle triangle given
legs of length x
and y
.
fn rem_euclid(self, other: f32) -> f32
fn rem_euclid(self, other: f32) -> f32
Calculates the least nonnegative remainder of self (mod other)
.