Java Epsilon epsilonEquals(float v1, float v2)

Here you can find the source of epsilonEquals(float v1, float v2)

Description

Determines whether two values are "close enough" to equal.

License

Apache License

Declaration

public static boolean epsilonEquals(float v1, float v2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** A small number. */
    public static final float EPSILON = 0.00001f;

    /**/*from ww  w.j  a  v  a  2 s  .c  o m*/
     * Determines whether two values are "close enough" to equal.
     */
    public static boolean epsilonEquals(float v1, float v2) {
        return Math.abs(v1 - v2) < EPSILON;
    }
}

Related

  1. epsilonCeiling(double value)
  2. epsilonEquals(final double a, final double b, final double epsilon)
  3. epsilonEquals(final float x, final float y)
  4. epsilonEquals(float f1, float f2, float epsilon)
  5. epsilonEquals(float p_180185_0_, float p_180185_1_)
  6. epsilonFloor(double d)
  7. epsilonZero(double input)