Java Number Difference difference(double m1, double M1, double m2, double M2)

Here you can find the source of difference(double m1, double M1, double m2, double M2)

Description

difference

License

Open Source License

Declaration

private static double difference(double m1, double M1, double m2, double M2) 

Method Source Code

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

public class Main {
    private static double difference(double m1, double M1, double m2, double M2) {
        if (M1 <= m2)
            return m2 - M1;
        if (M2 <= m1)
            return m1 - M2;

        //return Math.min(M1, M2) - Math.max(m1, m2);
        return 0;
    }/*from w ww .j a  v  a2s  .  c  o  m*/
}

Related

  1. difference(float x, float y)
  2. difference(int start, int boundary)
  3. difference(Integer value1, Integer value2)
  4. differenceModulo(int a, int b, int c)