I’m a beginner in programming, and in one of the exercises in a course I’m taking, I came across the weird result shown above.
I’m working on Windows and using Python 3, and I got the same result on Jupyter Notebook as well as Pycharm.
I tried to find an explanation for this online, but found nothing. Obviously I would expect the output to be 1.1. This occurs in other calculations I tried as well, such as 2 – 1.1 = 0.8999999999999999.
I know I can fix the output by using round(), but I’m interested in learning why I’m getting this result.
Source: Windows Questions