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 Answers
+ 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