Here you can find the source of GCD(double a, double b)
public static double GCD(double a, double b)
//package com.java2s; public class Main { public static double GCD(double a, double b) { return b == 0 ? a : GCD(b, a % b); }// ww w . ja v a 2 s. c om }