Here you can find the source of GCD(long a, long b)
public static long GCD(long a, long b)
//package com.java2s; //License from project: Apache License public class Main { public static long GCD(long a, long b) { if (b == 0) return a; return GCD(b, a % b); }/*from w w w. j ava 2s . c o m*/ }