Skip to content

Instantly share code, notes, and snippets.

@kali
Created December 5, 2016 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kali/2c7792f9d30c62692c4467efe1ae41cf to your computer and use it in GitHub Desktop.
Save kali/2c7792f9d30c62692c4467efe1ae41cf to your computer and use it in GitHub Desktop.
impl<I> ModularArithmetic for I
where
I: Clone + Sized,
I: Zero + One + Neg<Output=I> + NumberTests,
for<'a> &'a I: Mul<I, Output=I>,
for<'a,'b> &'a I: Mul<&'b I, Output=I>,
for<'a,'b> &'a I: Div<&'b I, Output=I>,
for<'a> I: Rem<&'a I, Output=I>,
for<'a,'b> &'a I: Rem<&'b I, Output=I>,
for<'a,'b> &'a I: Add<&'b I, Output=I>,
I: Sub<I, Output=I>,
for<'b> I: Sub<&'b I, Output=I>,
for<'a,'b> &'a I: Sub<&'b I, Output=I>,
I: Shr<usize, Output=I>,
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment