Java Utililty Methods Float Number Almost Equal

List of utility methods to do Float Number Almost Equal

Description

The list of methods to do Float Number Almost Equal are organized into topic(s).

Method

booleanalmostEqual(float a, float b, float maxRelativeError)
almost Equal
if (Float.isNaN(a) || Float.isNaN(b)) {
    return false;
if (a == b) {
    return true;
float relativeError;
if (Math.abs(b) > Math.abs(a)) {
...
booleanalmostEquals(final float value, final float expected)
almost Equals
return equals(value, expected, 1E-15f);