0

Hi,

Does anyone know a method or some code to find out whether two numbers have at least one common factor?

I currently have a gcd method that finds the greatest common divisor between two numbers however an arithmetic exception is thrown if the two numbers have no common divisor. The problem is i do not want this exception thrown so i need to check there is at least one factor between the numbers before i call the gcd method on them.

Any help would be appreciated,

Thanks