No post body was provided.
Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
1–6 of 6 posts
Re: Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
#2Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html
Re: Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
#3[deleted]
Re: Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
#4Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html
Thank you
Re: Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
#5Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html
Floating point isn't the issue. 'and' is a logical operator here. 0.1 and 0.1 is 0.1.
Re: Ask HN: Why does print (0.1 and 0.1 and 0.1 == 0.3) evaluate to False in Python?
#6Explanation for this behaviour is explained here - https://docs.python.org/3/library/decimal.html
Floating point isn't the issue. 'and' is a logical operator here. 0.1 and 0.1 is 0.1.
I believe author wanted to discuss addition and not logical operation. With logical operation, the question become trivial.