List of utility methods to do Float Number Equal
boolean | areFloatsEqual(float f1, float f2) used to compare two floats which are tested for having (almost) the same value return areFloatsEqual(f1, f2, 0.001F);
|
boolean | areFloatsEqual(float f1, float f2) are Floats Equal return (Math.abs(f1 - f2) < 0.0000001);
|
boolean | areFloatsEqual(Float one, Float two) Checks if two floats are equal - handles nulls boolean nullDiff = one == null ^ two == null; boolean valueDiff = one != null && two != null && !one.equals(two); return !nullDiff && !valueDiff; |
boolean | equal(float val1, float val2) Checks if two floats are equal based on identity. return Float.floatToIntBits(val1) == Float.floatToIntBits(val2); |
boolean | equals(float f1, float f2) equals return Math.abs(f1 - f2) < 0.0000001f;
|
boolean | floatEqual(float a, float b, float epsilon) float Equal return (Math.abs(a - b) < epsilon);
|
boolean | floatEqual(float f1, float f2) Returns whether the two specified float value are equal. float absDiff = Math.abs(f1 - f2); return absDiff < FP_EQUALITY_THRESHOLD; |
boolean | floatEquals(float a, float b) Implements the semantics of Float#equals(Object) for two primitive floats. return Float.floatToIntBits(a) == Float.floatToIntBits(b);
|
boolean | floatEquals(float x, float y) float Equals return Math.abs(x - y) < DELTA;
|