abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 7 months agoHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comexternal-linkmessage-square43fedilinkarrow-up1141arrow-down19
arrow-up1132arrow-down1external-linkHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 7 months agomessage-square43fedilink
minus-squaremagic_lobster_party@kbin.runlinkfedilinkarrow-up16·7 months agoIt’s both. As you said it’s because of loss of floating point precision, but it’s also with some of the quirks how Python compares int with float. These two together causes this strange behavior.
It’s both. As you said it’s because of loss of floating point precision, but it’s also with some of the quirks how Python compares int with float. These two together causes this strange behavior.