use crate::integer::Integer;
use core::cmp::Ordering;
use malachite_base::num::arithmetic::traits::UnsignedAbs;
use malachite_base::num::comparison::traits::PartialOrdAbs;
macro_rules! impl_float {
($t: ident) => {
impl PartialOrdAbs<$t> for Integer {
fn partial_cmp_abs(&self, other: &$t) -> Option<Ordering> {
self.unsigned_abs().partial_cmp(&other.abs())
}
}
impl PartialOrdAbs<Integer> for $t {
#[inline]
fn partial_cmp_abs(&self, other: &Integer) -> Option<Ordering> {
other.partial_cmp_abs(self).map(Ordering::reverse)
}
}
};
}
apply_to_primitive_floats!(impl_float);