Float operation
Hello,
I'm sorry about asking this question again, but I have not found any response clear enough!
The addition of float primitives do not return an exact value. For example :
float f1 = 4.8f;
float f2 = 0.8f;
System.out.println(f1+f2);
System.out.println(new BigDecimal(f1).add(new BigDecimal(f2)).floatValue());
Result :
5.6000004
5.6000004
There is an excellent raison for that, and I don't care about it.
The true is that this result is false, 4.8 + 0.8 = 5.6
What is the simplest way for doing that?
My apologies for my english.

