@[email protected] to [email protected]English • 4 months agoHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comexternal-linkmessage-square43fedilinkarrow-up1143arrow-down19cross-posted to: programming
arrow-up1134arrow-down1external-linkHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.com@[email protected] to [email protected]English • 4 months agomessage-square43fedilinkcross-posted to: programming
minus-square@[email protected]linkfedilinkEnglish2•4 months agoThey wouldn’t be running into an issue, but creating one, that’s different
minus-square@[email protected]linkfedilinkEnglish1•4 months agoMeh. Imo anyone comparing an integer to a float and not expecting one of them to be implicitly casted to the other’s type will create that issue for themselves when doing the same thing with an explicit cast.
minus-square@[email protected]linkfedilinkEnglish3•4 months agoWhat I meant is, the former can be a genuine mistake, the latter is a conscious (probably uneducated) decision
They wouldn’t be running into an issue, but creating one, that’s different
Meh. Imo anyone comparing an integer to a float and not expecting one of them to be implicitly casted to the other’s type will create that issue for themselves when doing the same thing with an explicit cast.
What I meant is, the former can be a genuine mistake, the latter is a conscious (probably uneducated) decision