Java lcm lcm(int numberOne, int numberTwo)

Here you can find the source of lcm(int numberOne, int numberTwo)

Description

lcm

License

Open Source License

Declaration

public static int lcm(int numberOne, int numberTwo) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int lcm(int numberOne, int numberTwo) {
        return numberOne % numberTwo == 0 ? numberOne : numberOne
                * numberTwo / gcd(numberOne, numberTwo);
    }/*from w  ww  .j  av a 2s .  co m*/

    public static int gcd(int largerNumber, int smallerNumber) {
        return (smallerNumber == 0) ? largerNumber : gcd(smallerNumber,
                largerNumber % smallerNumber);
    }
}

Related

  1. lcm(int m, int n)
  2. LCM(int m, int n)
  3. lcm(int n, int m)
  4. lcm(int num1, int num2)
  5. lcm(int num1, int num2)
  6. lcm(int p, int q)
  7. lcm(int x1, int x2)
  8. lcm(long a, long b)
  9. lcm(long a, long b)