i want to multiply 10.03 to 100 (exactly : 10.03 * 100).
I wrote this code below.
but the output is not what I expected.
i think the output should be 1003.0
but it prints 1002.9999999999999
why does it happen?
here's my code :
public class ComputeChange {
public static void main(String[] args) {
double num = 10.03;
System.out.println("number is : " + num);
double multiply = num * 100;
System.out.println("multiply to 100 : " + multiply);
}
}