pub trait F64Polyfill: Sized {
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;
}
impl F64Polyfill for f64 {
fn abs(self) -> f64 {
libm::fabs(self)
}
fn acos(self) -> f64 {
libm::acos(self)
}
fn asin(self) -> f64 {
libm::asin(self)
}
fn atan(self) -> f64 {
libm::atan(self)
}
fn atan2(self, other: f64) -> f64 {
libm::atan2(self, other)
}
fn ceil(self) -> f64 {
libm::ceil(self)
}
fn copysign(self, sign: f64) -> f64 {
libm::copysign(self, sign)
}
fn cos(self) -> f64 {
libm::cos(self)
}
fn exp(self) -> f64 {
libm::exp(self)
}
fn floor(self) -> f64 {
libm::floor(self)
}
fn hypot(self, other: f64) -> f64 {
libm::hypot(self, other)
}
fn ln(self) -> f64 {
libm::log(self)
}
fn log2(self) -> f64 {
libm::log2(self)
}
fn log10(self) -> f64 {
libm::log10(self)
}
fn mul_add(self, a: f64, b: f64) -> f64 {
(self * a) + b
}
fn powf(self, n: f64) -> f64 {
libm::pow(self, n)
}
fn powi(self, n: i64) -> f64 {
libm::pow(self, n as f64)
}
fn recip(self) -> f64 {
1.0/self
}
fn round(self) -> f64 {
libm::round(self)
}
fn sin(self) -> f64 {
libm::sin(self)
}
fn sin_cos(self) -> (f64, f64) {
libm::sincos(self)
}
fn sqrt(self) -> f64 {
libm::sqrt(self)
}
fn tan(self) -> f64 {
libm::tan(self)
}
fn trunc(self) -> f64 {
libm::trunc(self)
}
}