Java Double Number Almost Equal almostEquals(double d1, double d2, double threshold)

Here you can find the source of almostEquals(double d1, double d2, double threshold)

Description

almost Equals

License

Open Source License

Declaration

public static boolean almostEquals(double d1, double d2, double threshold) 

Method Source Code

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

public class Main {

    public static boolean almostEquals(double d1, double d2, double threshold) {
        if (d1 >= d2 - threshold && d1 <= d2 + threshold) {
            return true;
        } else {//w  w w  .j  ava2s . c  om
            return false;
        }
    }
}

Related

  1. almostEqual(double a, double b, double delta)
  2. almostEqual(double[][] a, double[][] b, double delta)
  3. almostEqual(final double aDouble, final double otherDouble)
  4. almostEquals(double d1, double d2)
  5. almostEquals(double d1, double d2, double epsilon)