when use Java NetBeans
double purchase = 19.93;
double payment = 20.00;
double change = payment - purchase;
System.out.println(change);
the result is : 0.07000000000000028 when I use Math.round method I got result "0" zero! I don't want zero I want 0.07 but when I do multiply by 100 then divide by 100 I got 0.07 easily!!!
double round = Math.round(change * 100.0) / 100.0;
System.out.println(rounded);
Result : 0.07!!
what is the reasons behind that? I'm beginner in java pls answer me as beginner