Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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);
    }
}