macro_rules! forward_ref_binop {
(impl $imp:ident, $method:ident) => {
impl<'a> $imp<f256> for &'a f256 {
type Output = <f256 as $imp<f256>>::Output;
#[inline(always)]
fn $method(self, rhs: f256) -> Self::Output {
$imp::$method(*self, rhs)
}
}
impl $imp<&f256> for f256 {
type Output = <f256 as $imp<f256>>::Output;
#[inline(always)]
fn $method(self, rhs: &f256) -> Self::Output {
$imp::$method(self, *rhs)
}
}
impl $imp<&f256> for &f256 {
type Output = <f256 as $imp<f256>>::Output;
#[inline(always)]
fn $method(self, rhs: &f256) -> Self::Output {
$imp::$method(*self, *rhs)
}
}
};
}
macro_rules! forward_op_assign {
(impl $imp:ident, $method:ident, $base_imp:ident, $base_method:ident) => {
impl<T> $imp<T> for f256
where
f256: $base_imp<T, Output = Self>,
{
#[inline(always)]
fn $method(&mut self, rhs: T) {
*self = $base_imp::$base_method(*self, rhs);
}
}
};
}
mod add;
mod cmp;
mod div;
pub(crate) mod mul;
mod rem;