abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 1 month agoHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comexternal-linkmessage-square34fedilinkarrow-up1107arrow-down15
arrow-up1102arrow-down1external-linkHow Python Compares Floats and Ints: When Equals Isn’t Really Equalblog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 1 month agomessage-square34fedilink
minus-squaremagic_lobster_party@kbin.runlinkfedilinkarrow-up13·1 month 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.