https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
https://stackoverflow.com/questions/2896013/manipulating-and-comparing-floating-points-in-java
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
find: Epsilon comparisons
and study it!!!
public static int compareFloats(float f1, float f2, float delta)
{
if (Math.abs(f1 - f2) < delta)
{
return 0;
} else
{
if (f1 < f2)
{
return -1;
} else {
return 1;
}
}
}