Java Epsilon epsilonEquals(float f1, float f2, float epsilon)

Here you can find the source of epsilonEquals(float f1, float f2, float epsilon)

Description

epsilon Equals

License

Apache License

Declaration

public static boolean epsilonEquals(float f1, float f2, float epsilon) 

Method Source Code

//package com.java2s;
/**/*from  www.  ja  v a  2  s  .c o  m*/
 * Legend of Rogue
 * An AHS Gaming Production
 * (c) 2013 Jami Couch
 * fbcouch 'at' gmail 'dot' com
 * Licensed under Apache 2.0
 * See www.ahsgaming.com for more info
 * 
 * LibGDX
 * (c) 2011 see LibGDX authors file
 * Licensed under Apache 2.0
 * 
 * Pixelated Fonts by Kenney, Inc. Licensed as CC-SA.
 * See http://kenney.nl for more info.
 * 
 * All other art assets (c) 2013 Jami Couch, licensed CC-BY-SA
 */

public class Main {
    public static boolean epsilonEquals(float f1, float f2, float epsilon) {
        return (f1 + epsilon >= f2 && f1 - epsilon <= f2);
    }
}

Related

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