Java Number Min Value minCommonMultiple(int m, int n)

Here you can find the source of minCommonMultiple(int m, int n)

Description

min Common Multiple

License

Open Source License

Declaration

public static int minCommonMultiple(int m, int n) 

Method Source Code

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

public class Main {
    public static int minCommonMultiple(int m, int n) {
        return m * n / maxCommonDivisor(m, n);
    }// ww  w  .  java 2  s .  com

    public static int maxCommonDivisor(int m, int n) {
        if (m < n) { // keep the order m > n
            int temp = m;
            m = n;
            n = temp;
        }
        if (m % n == 0) { // if m divide by n is 0, n is the max common divisor
            return n;
        }
        return maxCommonDivisor(n, m % n); // recurse n and the remainder of m divide n
    }
}

Related

  1. MIN4(int x, int y, int z, int a)
  2. min8(double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)
  3. MIN_MAX(int min, int mid, int max)
  4. minChar(String input)
  5. minCharsForCriteria(final int length, final int criteria)
  6. minComparable(T first, T second)
  7. minCoverageEstimate(short mask)
  8. minCurveSegmentLength(String segmentTypeName)
  9. minDark(final int colorValue)