I am using Python 3.6.5. As a part of a problem I had to do 0.6/0.1. But the output I am getting is different:
0.6/0.1
5.999999999999999
Also I checked other numbers , this is what happens
0.4/0.1
4.0
0.5/0.1
5.0
0.6/0.1
5.999999999999999
0.7/0.1
6.999999999999999
0.8/0.1
8.0
0.9/0.1
9.0
0.99/0.1
9.899999999999999
0.89/0.1
8.9
0.79/0.1
7.9
0.69/0.1
6.8999999999999995
0.59/0.1
5.8999999999999995
0.49/0.1
4.8999999999999995
0.39/0.1
3.9
Am I doing something wrong or is this a bug.Why are the output for 0.6/0.1 and 0.5/0.1 in different formats and how to work around this