Skip to content

Cannot reliably compare uint64 values to integers? #5746

Closed

Description

@nasailja

According to this program any value between ...cde0 and ...cdef is equal to uint64 value of ...cdef which was a big surprise

import numpy
a = numpy.uint64(0x1234567890abcdef)
if a == 0x1234567890abcde0:
    print("BUG!")

Seems like uint64 is converted to float even when it is compared against standard integers which was another big surprise for me.

Activity

  1. jaimefrio commented on Apr 4, 2015

    @jaimefrio
    Member

    Probably related to #5612.

  2. nasailja commented on Apr 4, 2015

    @nasailja
    Author

    Looks more like a bug in uint64: #5745

  3. seberg commented on Nov 19, 2022

    @seberg
    Member

    Closing as duplicate of gh-22624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions