Floats Equal - Android java.lang

Android examples for java.lang:Float

Description

Floats Equal

Demo Code


//package com.java2s;

public class Main {
    /**/*from w  w  w.ja v a 2 s.  c om*/
     * @return true iff |f1 - f2| <= epsilon
     */
    public static boolean FloatsEqual(float epsilon, float f1, float f2) {
        return (Math.abs(f1 - f2) <= epsilon);
    }
}

Related Tutorials