Top "Equality" questions

Equality is a relationship between two or more items or variables or objects that exists if (1) the items are the same item, variable, or object or (2) the items are different items, variables or objects but they have the same value.

Implementing -hash / -isEqual: / -isEqualTo...: for Objective-C collections

Note: The following SO questions are related, but neither they nor the linked resources seem to fully answer my questions, …

objective-c cocoa data-structures equality chdatastructures
JavaScript - === vs == operators performance

A few weeks ago, I have read this thread Is < faster than <=? about comparison operators in C. It …

javascript performance equality comparison-operators equality-operator
On Java 7's equals() and deepEquals()

Method description says: Returns true if the arguments are deeply equal to each other and false otherwise... Equality is determined …

equality java-7 deepequals
What's the right way to implement equality in ruby

For a simple struct-like class: class Tiger attr_accessor :name, :num_stripes end what is the correct way to implement …

ruby equality
When to use == and when to use is?

Curiously: >>> a = 123 >>> b = 123 >>> a is b True >>> a = 123. &…

python memory equality
Testing for reference equality in Python

Say I have a class in Python that has an eq method defined for comparing attributes for equality: class Foo(…

python reference equality
GetHashCode on null fields?

How do I deal with null fields in GetHashCode function? Module Module1 Sub Main() Dim c As New Contact Dim …

null nullreferenceexception equality gethashcode iequatable
Equality Test for Derived Classes in C++

Possible Duplicate: What’s the right way to overload operator== for a class hierarchy? In C++, how can derived classes …

c++ inheritance operators equality equals-operator
LINQ: Use .Except() on collections of different types by making them convertible/comparable?

Given two lists of different types, is it possible to make those types convertible between or comparable to each other (…

c# linq comparison equality comparable
Surprising Tuple (in)equality

Until today, my understanding of .NET Tuple classes had been that they delegate their implementation of Equals() to their contents, …

c# equality tuples