pub trait F32Polyfill: Sized {
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;
}
impl F32Polyfill for f32 {
fn abs(self) -> f32 {
libm::fabsf(self)
}
fn acos(self) -> f32 {
libm::acosf(self)
}
fn asin(self) -> f32 {
libm::asinf(self)
}
fn atan(self) -> f32 {
libm::atanf(self)
}
fn atan2(self, other: f32) -> f32 {
libm::atan2f(self, other)
}
fn ceil(self) -> f32 {
libm::ceilf(self)
}
fn copysign(self, sign: f32) -> f32 {
libm::copysignf(self, sign)
}
fn cos(self) -> f32 {
libm::cosf(self)
}
fn exp(self) -> f32 {
libm::expf(self)
}
fn floor(self) -> f32 {
libm::floorf(self)
}
fn hypot(self, other: f32) -> f32 {
libm::hypotf(self, other)
}
fn ln(self) -> f32 {
libm::logf(self)
}
fn log2(self) -> f32 {
libm::log2f(self)
}
fn log10(self) -> f32 {
libm::log10f(self)
}
fn mul_add(self, a: f32, b: f32) -> f32 {
(self * a) + b
}
fn powf(self, n: f32) -> f32 {
libm::powf(self, n)
}
fn powi(self, n: i32) -> f32 {
libm::powf(self, n as f32)
}
fn recip(self) -> f32 {
1.0/self
}
fn round(self) -> f32 {
libm::roundf(self)
}
fn sin(self) -> f32 {
libm::sinf(self)
}
fn sin_cos(self) -> (f32, f32) {
libm::sincosf(self)
}
fn sqrt(self) -> f32 {
libm::sqrtf(self)
}
fn tan(self) -> f32 {
libm::tanf(self)
}
fn trunc(self) -> f32 {
libm::truncf(self)
}
}