I couldn't resolve the following quirk when doing simple addition in Dart.
void main(){
print(5.9+0.7);
}
The output is:
6.6000000000000005
But when I use some different numbers ;
void main(){
print(5.9+0.6);
print(5.9+0.7);
print(5.9+0.8);
print(5.9+0.9);
}
The output is :
6.5
6.6000000000000005
6.7
6.800000000000001
And here is a different example :
void main(){
print(25.90+20.70+4);
}
The output is :
50.599999999999994
What may be the reason of this strangeness.
Is there ay solution suggestion to solve this problem?