Effective Java with Groovy - When float and double put you in trouble!
Let's start with a Java program! What do you think the following program would print?
float price = 0.1f;
float amount = 0f;
for (int i = 0; i < 10; i++) {
amount += price;
}
System.out.println("Total price: " + amount);
Well, the developer indeed intended the amount to