Java BigInteger Calculate gcdEuclides(BigInteger a, BigInteger b)

Here you can find the source of gcdEuclides(BigInteger a, BigInteger b)

Description

gcd Euclides

License

Open Source License

Declaration

public static BigInteger gcdEuclides(BigInteger a, BigInteger b) 

Method Source Code


//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));
    }
}

Related

  1. firstLtSecond(BigInteger first, BigInteger second)
  2. gcd(BigInteger a, BigInteger b)
  3. GCD(BigInteger x, BigInteger y)
  4. gcd(BigInteger... values)
  5. gcd(Iterable nums)
  6. gcdExtended(BigInteger p, BigInteger q)
  7. getAddressText(BigInteger address)
  8. getByteArrayFromBigIntegerArray(Object value)
  9. getBytes(BigInteger bi, int minLen)