/*
	fct_gcd(a, b)

	Return the greatest common divisor of a and b.

	Adapted 8-15-90 by WRG from code by S. Altschul.
*/
#include <ncbi.h>
#include <gishlib.h>

long
fct_gcd(a, b)
	register long	a, b;
{
	register long	c;

	b = ABS(b);
	if (b > a)
		c=a, a=b, b=c;

	while (b != 0) {
		c = a%b;
		a = b;
		b = c;
	}
	return a;
}
