Here you can find the source of gcdEuclides(BigInteger a, BigInteger b)
public static BigInteger gcdEuclides(BigInteger a, BigInteger b)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; public class Main { public static BigInteger gcdEuclides(BigInteger a, BigInteger b) { if (b.equals(BigInteger.ZERO)) { return a; }// ww w .java 2 s.co m return gcdEuclides(b, a.mod(b)); } }