Java Number Sign signumEps(double val, double eps)

Here you can find the source of signumEps(double val, double eps)

Description

Signum functions with epsilon for floating point imprecision

License

Open Source License

Declaration

public static double signumEps(double val, double eps) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w  w  w.  j av  a  2  s .  co m*/
     * Signum functions with epsilon for floating point imprecision
     */
    public static double signumEps(double val, double eps) {
        if (val < eps && val > -eps)
            return 0;
        else
            return Math.signum(val);
    }
}

Related

  1. signum(int a)
  2. signum(int v)
  3. signum(long diff)
  4. signum(long l)
  5. signum(long number)