#![no_std]
mod eq;
mod ne;
#[doc(hidden)]
pub trait FloatExt: Copy {
fn abs(self) -> Self;
fn __get_error(self, other: Self) -> Self;
}
impl FloatExt for f32 {
#[inline]
fn abs(self) -> Self {
f32::abs(self)
}
#[inline]
fn __get_error(self, other: Self) -> Self {
self.abs().min(other.abs()) * f32::EPSILON * 8.0
}
}
impl FloatExt for f64 {
#[inline]
fn abs(self) -> Self {
f64::abs(self)
}
#[inline]
fn __get_error(self, other: Self) -> Self {
self.abs().min(other.abs()) * f64::EPSILON * 8.0
}
}
#[doc(hidden)]
#[inline]
pub fn get_error<T: FloatExt>(a: T, b: T) -> T {
a.__get_error(b)
}