Here you can find the source of areEqual(double d1, double d2)
private static boolean areEqual(double d1, double d2)
//package com.java2s; //License from project: Apache License public class Main { static final double EQUALITY_TOLERANS = 0.1; private static boolean areEqual(double d1, double d2) { return ((d1 + EQUALITY_TOLERANS >= d2) && (d1 - EQUALITY_TOLERANS <= d2)); }/*from w ww .ja v a2 s. com*/ }