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§
Sourcefn hypot(self, other: f32) -> f32
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().
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.