Code example for BigInteger

Methods: divide, equals, mod

0
	} 
 
	private static BigInteger recurseEuclidean(BigInteger x, BigInteger y,
			BigInteger[] vals) {
 
		if (y.equals(BigInteger.ZERO)) {
			if (vals != null) {
				vals[0] = BigInteger.ONE;
				vals[1] = BigInteger.ZERO;
			} 
			return x;
		} 
 
		BigInteger ans = recurseEuclidean(y, x.mod(y), vals);
		if (vals != null) {
			BigInteger temp = vals[0].subtract(x.divide(y).multiply(vals[1]));
			vals[0] = vals[1];
			vals[1] = temp;
		} 
		return ans;
	}