Java lcm LCM(double a, double b)

Here you can find the source of LCM(double a, double b)

Description

LCM

License

Open Source License

Declaration

public static double LCM(double a, double b) 

Method Source Code

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

Related

  1. lcm(int a, int b)
  2. lcm(int a, int b)
  3. lcm(int a, int b)
  4. lcm(int a, int b)