Here you can find the source of LCM(double a, double b)
public static double LCM(double a, double b)
//package com.java2s; public class Main { public static double LCM(double a, double b) { double largerValue = a; double smallerValue = b; if (b > a) { largerValue = b;/* w ww.j a v a 2 s. c o m*/ smallerValue = a; } for (int i = 1; i <= largerValue; i++) { if ((largerValue * i) % smallerValue == 0) { return largerValue * i; } } return largerValue * smallerValue; } }