Skip to content

Equals comparison fails on extreme ends of 64-bit integers #5975

@BrianM-UEI

Description

@BrianM-UEI

Equals comparison fails on numbers within the ranges of (-0x4000000000000000, -0x8000000000000000] and [0x4000000000000000, 0x7FFFFFFFFFFFFFFF] when compared against themselves. This was checked against the base mruby 3.2.0 and 3.1.0 (excluding the success outside of the signed int range) releases. (Note: The hex representation of signed int min works.)

-0x4000000000000001 == -0x4000000000000001
=> false
-9223372036854775808 == -9223372036854775808
=> false
-0x4000000000000000 == -0x4000000000000000
=> true
-9223372036854775809 == -9223372036854775809
=> true
0x4000000000000000 == 0x4000000000000000
=> false
0x7FFFFFFFFFFFFFFF == 0x7FFFFFFFFFFFFFFF
=> false
0x3FFFFFFFFFFFFFFF == 0x3FFFFFFFFFFFFFFF
=> true
0x8000000000000000 == 0x8000000000000000
=> true

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