Here you can find the source of isCoprime(BigInteger a, BigInteger b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static boolean isCoprime(BigInteger a, BigInteger b)
//package com.java2s; //License from project: Apache License import java.math.BigInteger; public class Main { /**//from w w w.ja v a 2 s. c om * Returns true if A and B are coprime. A and B * are considered coprime if A and B share no GCD * other than 1. * * @param a * @param b * @return */ public static boolean isCoprime(BigInteger a, BigInteger b) { return a.gcd(b).equals(BigInteger.ONE); } }