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; }