0

x = 0.1+0.1+0.1-0.3 print ('x is {}'.format(x)) print (type(x))

Why output is not 0.

4th Jan 2021, 2:40 AM
Anil R Chinchawade
Anil R Chinchawade - avatar
2 Respostas
+ 1
The output is something extremely close to 0. The reason can be referred to this post: https://stackoverflow.com/questions/588004/is-floating-point-math-broken
4th Jan 2021, 4:09 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Thank you..
4th Jan 2021, 10:52 AM
Anil R Chinchawade
Anil R Chinchawade - avatar