I'm a little confused about the precision of The Dart 'double' type, for example,
void main() {
double num1 = 0.55 * 10; // 5.5
double num2 = 0.55 * 100; // 55.00000000000001
double num3 = 0.55 * 1000; // 550
double num4 = 0.45 * 100; // 45
print("num1: $num1, num2: $num2, num3: $num3, num4: $num4");
}
the print is:
num1: 5.5, num2: 55.00000000000001, num3: 550, num4: 45
just num2's precision is exceptional.
I don't know why. Can anyone help me with that? Thank you very much ^_^