gcd static method

double gcd(
  1. double x,
  2. double y
)

Implementation

static double gcd( double x, double y ){
	if( isNan( x ) ) return x;
	if( isNan( y ) ) return y;
	x = toInt( x );
	y = toInt( y );
	double t;
	while( y != 0 ){
		t = mod( x, y );
		x = y;
		y = t;
	}
	return x;
}