Advertisement
Guest User

Fast GCD

a guest
Mar 7th, 2015
1,130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.10 KB | None | 0 0
  1. template<typename T>
  2. T gcd(T a, T b) {
  3.     while((a %= b) && (b %= a));
  4.     return a | b;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement