How Python Compares Floats and Ints: When Equals Isn’t Really Equal - eviltoast
  • magic_lobster_party@kbin.run
    link
    fedilink
    arrow-up
    16
    ·
    6 months ago

    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.