Again and again I see developers using doubles for storing financial data (e.g. monetary figures, interest rates etc.). This always causes some sort of rounding issue down the line.
try this in your IDE:
double total = 0;
for (int i =0; i < 10; i++){
total += 0.1;
}
System.out.println(total);
If you expect the answer to be 1 or 1.0, then you’re wrong !
Question: are you writing a game ? Answer: no; then use an effing BigDecimal!
Grrr…