use super::helpers::subtract_reuse_lhs;
use crate::{integer::Integer, rational::Rational};
use core::ops::Sub;
impl Sub<Rational> for Rational {
type Output = Rational;
fn sub(mut self, rhs: Rational) -> Self::Output {
Rational::subtract_assign(&mut self, &rhs);
self
}
}
impl Sub<&Rational> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &Rational) -> Self::Output {
Rational::subtract_assign(&mut self, rhs);
self
}
}
impl Sub<Rational> for &Rational {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
Rational::subtract(self, &rhs)
}
}
impl Sub<&Rational> for &Rational {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
Rational::subtract(self, rhs)
}
}
impl Sub<Integer> for Rational {
type Output = Rational;
fn sub(mut self, rhs: Integer) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &rhs);
self
}
}
impl Sub<&Integer> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &Integer) -> Self::Output {
Rational::subtract_assign_integer(&mut self, rhs);
self
}
}
impl Sub<Integer> for &Rational {
type Output = Rational;
fn sub(self, rhs: Integer) -> Self::Output {
Rational::subtract_integer(self, &rhs)
}
}
impl Sub<&Integer> for &Rational {
type Output = Rational;
fn sub(self, rhs: &Integer) -> Self::Output {
Rational::subtract_integer(self, rhs)
}
}
impl Sub<Rational> for Integer {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for Integer {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &Integer {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &Integer {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<i8> for Rational {
type Output = Rational;
fn sub(mut self, rhs: i8) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&i8> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &i8) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<i8> for &Rational {
type Output = Rational;
fn sub(self, rhs: i8) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&i8> for &Rational {
type Output = Rational;
fn sub(self, rhs: &i8) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for i8 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for i8 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &i8 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &i8 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<u8> for Rational {
type Output = Rational;
fn sub(mut self, rhs: u8) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&u8> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &u8) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<u8> for &Rational {
type Output = Rational;
fn sub(self, rhs: u8) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&u8> for &Rational {
type Output = Rational;
fn sub(self, rhs: &u8) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for u8 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for u8 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &u8 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &u8 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<i16> for Rational {
type Output = Rational;
fn sub(mut self, rhs: i16) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&i16> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &i16) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<i16> for &Rational {
type Output = Rational;
fn sub(self, rhs: i16) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&i16> for &Rational {
type Output = Rational;
fn sub(self, rhs: &i16) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for i16 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for i16 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &i16 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &i16 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<u16> for Rational {
type Output = Rational;
fn sub(mut self, rhs: u16) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&u16> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &u16) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<u16> for &Rational {
type Output = Rational;
fn sub(self, rhs: u16) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&u16> for &Rational {
type Output = Rational;
fn sub(self, rhs: &u16) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for u16 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for u16 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &u16 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &u16 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<i32> for Rational {
type Output = Rational;
fn sub(mut self, rhs: i32) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&i32> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &i32) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<i32> for &Rational {
type Output = Rational;
fn sub(self, rhs: i32) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&i32> for &Rational {
type Output = Rational;
fn sub(self, rhs: &i32) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for i32 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for i32 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &i32 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &i32 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<u32> for Rational {
type Output = Rational;
fn sub(mut self, rhs: u32) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&u32> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &u32) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<u32> for &Rational {
type Output = Rational;
fn sub(self, rhs: u32) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&u32> for &Rational {
type Output = Rational;
fn sub(self, rhs: &u32) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for u32 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for u32 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &u32 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &u32 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<i64> for Rational {
type Output = Rational;
fn sub(mut self, rhs: i64) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&i64> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &i64) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<i64> for &Rational {
type Output = Rational;
fn sub(self, rhs: i64) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&i64> for &Rational {
type Output = Rational;
fn sub(self, rhs: &i64) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for i64 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for i64 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &i64 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &i64 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<u64> for Rational {
type Output = Rational;
fn sub(mut self, rhs: u64) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&u64> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &u64) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<u64> for &Rational {
type Output = Rational;
fn sub(self, rhs: u64) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&u64> for &Rational {
type Output = Rational;
fn sub(self, rhs: &u64) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for u64 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for u64 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &u64 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &u64 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<i128> for Rational {
type Output = Rational;
fn sub(mut self, rhs: i128) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&i128> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &i128) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<i128> for &Rational {
type Output = Rational;
fn sub(self, rhs: i128) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&i128> for &Rational {
type Output = Rational;
fn sub(self, rhs: &i128) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for i128 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for i128 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &i128 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &i128 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<u128> for Rational {
type Output = Rational;
fn sub(mut self, rhs: u128) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(rhs));
self
}
}
impl Sub<&u128> for Rational {
type Output = Rational;
fn sub(mut self, rhs: &u128) -> Self::Output {
Rational::subtract_assign_integer(&mut self, &Integer::from(*rhs));
self
}
}
impl Sub<u128> for &Rational {
type Output = Rational;
fn sub(self, rhs: u128) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(rhs))
}
}
impl Sub<&u128> for &Rational {
type Output = Rational;
fn sub(self, rhs: &u128) -> Self::Output {
Rational::subtract_integer(self, &Integer::from(*rhs))
}
}
impl Sub<Rational> for u128 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for u128 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}
impl Sub<Rational> for &u128 {
type Output = Rational;
fn sub(self, rhs: Rational) -> Self::Output {
subtract_reuse_lhs(self, &rhs)
}
}
impl Sub<&Rational> for &u128 {
type Output = Rational;
fn sub(self, rhs: &Rational) -> Self::Output {
subtract_reuse_lhs(self, rhs)
}
}