use super::helpers::{add_reuse_lhs, add_reuse_rhs};
use crate::{integer::Integer, rational::Rational};
use core::ops::Add;
impl Add<Rational> for Rational {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_lhs(self, &rhs)
}
}
impl Add<&Rational> for Rational {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &Rational {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&Rational> for &Rational {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
Rational::add(self, rhs)
}
}
impl Add<Integer> for Rational {
type Output = Rational;
fn add(self, rhs: Integer) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&Integer> for Rational {
type Output = Rational;
fn add(self, rhs: &Integer) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<Integer> for &Rational {
type Output = Rational;
fn add(self, rhs: Integer) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&Integer> for &Rational {
type Output = Rational;
fn add(self, rhs: &Integer) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for Integer {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for Integer {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &Integer {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &Integer {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<i8> for Rational {
type Output = Rational;
fn add(self, rhs: i8) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&i8> for Rational {
type Output = Rational;
fn add(self, rhs: &i8) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<i8> for &Rational {
type Output = Rational;
fn add(self, rhs: i8) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&i8> for &Rational {
type Output = Rational;
fn add(self, rhs: &i8) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for i8 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for i8 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &i8 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &i8 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<u8> for Rational {
type Output = Rational;
fn add(self, rhs: u8) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&u8> for Rational {
type Output = Rational;
fn add(self, rhs: &u8) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<u8> for &Rational {
type Output = Rational;
fn add(self, rhs: u8) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&u8> for &Rational {
type Output = Rational;
fn add(self, rhs: &u8) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for u8 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for u8 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &u8 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &u8 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<i16> for Rational {
type Output = Rational;
fn add(self, rhs: i16) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&i16> for Rational {
type Output = Rational;
fn add(self, rhs: &i16) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<i16> for &Rational {
type Output = Rational;
fn add(self, rhs: i16) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&i16> for &Rational {
type Output = Rational;
fn add(self, rhs: &i16) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for i16 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for i16 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &i16 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &i16 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<u16> for Rational {
type Output = Rational;
fn add(self, rhs: u16) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&u16> for Rational {
type Output = Rational;
fn add(self, rhs: &u16) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<u16> for &Rational {
type Output = Rational;
fn add(self, rhs: u16) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&u16> for &Rational {
type Output = Rational;
fn add(self, rhs: &u16) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for u16 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for u16 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &u16 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &u16 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<i32> for Rational {
type Output = Rational;
fn add(self, rhs: i32) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&i32> for Rational {
type Output = Rational;
fn add(self, rhs: &i32) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<i32> for &Rational {
type Output = Rational;
fn add(self, rhs: i32) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&i32> for &Rational {
type Output = Rational;
fn add(self, rhs: &i32) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for i32 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for i32 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &i32 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &i32 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<u32> for Rational {
type Output = Rational;
fn add(self, rhs: u32) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&u32> for Rational {
type Output = Rational;
fn add(self, rhs: &u32) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<u32> for &Rational {
type Output = Rational;
fn add(self, rhs: u32) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&u32> for &Rational {
type Output = Rational;
fn add(self, rhs: &u32) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for u32 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for u32 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &u32 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &u32 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<i64> for Rational {
type Output = Rational;
fn add(self, rhs: i64) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&i64> for Rational {
type Output = Rational;
fn add(self, rhs: &i64) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<i64> for &Rational {
type Output = Rational;
fn add(self, rhs: i64) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&i64> for &Rational {
type Output = Rational;
fn add(self, rhs: &i64) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for i64 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for i64 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &i64 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &i64 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<u64> for Rational {
type Output = Rational;
fn add(self, rhs: u64) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&u64> for Rational {
type Output = Rational;
fn add(self, rhs: &u64) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<u64> for &Rational {
type Output = Rational;
fn add(self, rhs: u64) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&u64> for &Rational {
type Output = Rational;
fn add(self, rhs: &u64) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for u64 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for u64 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &u64 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &u64 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<i128> for Rational {
type Output = Rational;
fn add(self, rhs: i128) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&i128> for Rational {
type Output = Rational;
fn add(self, rhs: &i128) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<i128> for &Rational {
type Output = Rational;
fn add(self, rhs: i128) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&i128> for &Rational {
type Output = Rational;
fn add(self, rhs: &i128) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for i128 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for i128 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &i128 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &i128 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<u128> for Rational {
type Output = Rational;
fn add(self, rhs: u128) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<&u128> for Rational {
type Output = Rational;
fn add(self, rhs: &u128) -> Self::Output {
add_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Add<u128> for &Rational {
type Output = Rational;
fn add(self, rhs: u128) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<&u128> for &Rational {
type Output = Rational;
fn add(self, rhs: &u128) -> Self::Output {
add_reuse_rhs(self, rhs)
}
}
impl Add<Rational> for u128 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for u128 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}
impl Add<Rational> for &u128 {
type Output = Rational;
fn add(self, rhs: Rational) -> Self::Output {
add_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Add<&Rational> for &u128 {
type Output = Rational;
fn add(self, rhs: &Rational) -> Self::Output {
add_reuse_lhs(self, rhs)
}
}