Here you can find the source of areEquals(double p, double q)
public static boolean areEquals(double p, double q)
//package com.java2s; //License from project: Open Source License public class Main { public static final double APPROX = 0.000001; public static boolean areEquals(double p, double q) { return p > q - APPROX && p < q + APPROX; }//from w w w . j av a 2 s . c om }