Java tutorial
//package com.java2s; public class Main { /** * Check if one double value equals to zero * @param obj * @param precision * @return */ public static boolean equalsToZero(double obj, int precision) { return Math.abs(obj) <= Math.pow(0.1, precision); } public static boolean equalsToZero(double obj) { return equalsToZero(obj, 6); } }