Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!


By: a guest on Sep 15th, 2012  |  syntax: Java  |  size: 0.11 KB  |  views: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public static long gcd(long p, long q){
  2.                 if (q==0) return p;
  3.                 long r = p % q;
  4.                 return Math.abs(gcd(q, r));
  5.         }
clone this paste RAW Paste Data