Here you can find the source of almostEquals(double d1, double d2, double threshold)
public static boolean almostEquals(double d1, double d2, double threshold)
//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; } } }