common divisiors of two integers
in java, I want an efficient program to find all common divisors betwen two integers...
for e.g. if there are two integers:-
30(2*3*5)
and
45(5*3*3)

Program should retrun 3, 5 which are common divisors between 30 and 45. I need the algorithm to be very efficient especially if value of two integers are very large.
common divisiors of two integers
===

in java, I want an efficient program to find all common divisors betwen two integers...
for e.g. if there are two integers:-
30(2*3*5)
and
45(5*3*3)

Program should retrun 3, 5 which are common divisors between 30 and 45. I need the algorithm to be very efficient especially if value of two integers are very large.