123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- use crate::Point;
- use std::ops::{Rem, RemAssign};
- use num::Integer;
- /*
- P % T
- P % (T, T)
- P % P
- P % &P
- P % &mP
- &P % T
- &P % (T, T)
- &P % P
- &P % &P
- &P % &mP
- &mP % T
- &mP % (T, T)
- &mP % P
- &mP % &P
- &mP % &mP
- P %= T
- P %= (T, T)
- P %= P
- P %= &P
- P %= &mP
- */
- impl<T: Integer + Copy> Rem<T> for Point<T> {
- type Output = Self;
- fn rem(self, rhs: T) -> Self::Output {
- Self::from((self.x%rhs, self.y%rhs))
- }
- }
- impl<T: Integer> Rem<(T, T)> for Point<T> {
- type Output = Self;
- fn rem(self, rhs: (T, T)) -> Self::Output {
- Self::from((self.x%rhs.0, self.y%rhs.1))
- }
- }
- impl<T: Integer> Rem<Point<T>> for Point<T> {
- type Output = Self;
- fn rem(self, rhs: Point<T>) -> Self::Output {
- Self::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&Point<T>> for Point<T> {
- type Output = Self;
- fn rem(self, rhs: &Point<T>) -> Self::Output {
- Self::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&mut Point<T>> for Point<T> {
- type Output = Self;
- fn rem(self, rhs: &mut Point<T>) -> Self::Output {
- Self::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<T> for &Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: T) -> Self::Output {
- Point::from((self.x%rhs, self.y%rhs))
- }
- }
- impl<T: Integer + Copy> Rem<(T, T)> for &Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: (T, T)) -> Self::Output {
- Point::from((self.x%rhs.0, self.y%rhs.1))
- }
- }
- impl<T: Integer + Copy> Rem<Point<T>> for &Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&Point<T>> for &Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: &Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&mut Point<T>> for &Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: &mut Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<T> for &mut Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: T) -> Self::Output {
- Point::from((self.x%rhs, self.y%rhs))
- }
- }
- impl<T: Integer + Copy> Rem<(T, T)> for &mut Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: (T, T)) -> Self::Output {
- Point::from((self.x%rhs.0, self.y%rhs.1))
- }
- }
- impl<T: Integer + Copy> Rem<Point<T>> for &mut Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&Point<T>> for &mut Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: &Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + Copy> Rem<&mut Point<T>> for &mut Point<T> {
- type Output = Point<T>;
- fn rem(self, rhs: &mut Point<T>) -> Self::Output {
- Point::from((self.x%rhs.x, self.y%rhs.y))
- }
- }
- impl<T: Integer + RemAssign + Copy> RemAssign<T> for Point<T> {
- fn rem_assign(&mut self, rhs: T) {
- self.x %= rhs;
- self.y %= rhs;
- }
- }
- impl<T: Integer + RemAssign> RemAssign<(T, T)> for Point<T> {
- fn rem_assign(&mut self, rhs: (T, T)) {
- self.x %= rhs.0;
- self.y %= rhs.1;
- }
- }
- impl<T: Integer + RemAssign + Copy> RemAssign<Point<T>> for Point<T> {
- fn rem_assign(&mut self, rhs: Point<T>) {
- self.x %= rhs.x;
- self.y %= rhs.y;
- }
- }
- impl<T: Integer + RemAssign + Copy> RemAssign<&Point<T>> for Point<T> {
- fn rem_assign(&mut self, rhs: &Point<T>) {
- self.x %= rhs.x;
- self.y %= rhs.y;
- }
- }
- impl<T: Integer + RemAssign + Copy> RemAssign<&mut Point<T>> for Point<T> {
- fn rem_assign(&mut self, rhs: &mut Point<T>) {
- self.x %= rhs.x;
- self.y %= rhs.y;
- }
- }
|