Skip to content

hashCode should be stable for any scale #15

@a14n

Description

@a14n
  var a = BigDecimal.parse('1.000');
  var b = BigDecimal.parse('1.00');
  // a and b are equal, but they have different hash codes
  print(a.hashCode);
  print(b.hashCode);
  print(a.hashCode == b.hashCode); // false (SHOULD be true)
  print(a == b); // true
  // so a set containing `a` does not contain `b` although they are equal
  print({a}.contains(b)); // false (SHOULD be 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