abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 6 months agoHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comexternal-linkmessage-square43fedilinkarrow-up1143
arrow-up1134external-linkHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 6 months agomessage-square43fedilink
minus-squaremagic_lobster_party@kbin.runlinkfedilinkarrow-up16·6 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.