package com.knecon.fforesight.service.layoutparser.processor.docstrum.utils;

public class DoubleUtils {

    public static int compareDouble(double d1, double d2, double precision) {

        if (Double.isNaN(d1) || Double.isNaN(d2)) {
            return Double.compare(d1, d2);
        }

        if (Math.abs(d1 - d2) < precision) {
            return 0;
        }

        return Double.compare(d1, d2);
    }

}
