Here you can find the source of euclideanGcd(long a, long b)
public static long euclideanGcd(long a, long b)
//package com.java2s; public class Main { public static long euclideanGcd(long a, long b) { while (b != 0) { long t = b; b = a % b;/* w w w.j a va 2 s .co m*/ a = t; } return a; } }