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.

Custom equality in swift objects preserving compatibility with legacy Objective-C code

In Objective-C you would do something along the lines of - (BOOL)isEqual:(id)other { if (other == self) return YES; …

equality swift
How to check if two Expression<Func<T, bool>> are the same

Is it possible to find out if two expressions are the same? Like given the following four expressions: Expression<…

c# expression equality
Override == operator in Ruby

According to the docs, Array.include? uses the == comparison on objects. I come from Java where such things are (usually) …

ruby overriding equality
how equal operator works with primitive and object type data

I know its a very basic question but I want to be clear about the concept. I want to know …

java equality unboxing
When "" == s is false but "".equals( s ) is true

EDIT Thanks for the prompt responses. Please see what the real question is. I have made it bold this time. …

java comparison equals equality
Why is x == (x = y) not the same as (x = y) == x?

Consider the following example: class Quirky { public static void main(String[] args) { int x = 1; int y = 3; System.out.println(x == (…

java variable-assignment equality operator-precedence jls
Assert that two java beans are equivalent

This question is close, but still not what I want. I'd like to assert in a generic way that two …

java unit-testing assert javabeans equality
Equality with Double.NaN

I have the following code... if (Price_Foreign != Double.NaN) { output.Append(spacer); output.Append(String.Format("{0,-10:C} USD",…

c# equality nan
What's the difference between identical(x, y) and isTRUE(all.equal(x, y))?

Is there any difference between testing isTRUE(all.equal(x, y)) and identical(x, y)? The help page says: Don't …

r comparison equality built-in floating-point-comparison
How do I check if two variables reference the same object in Python?

x and y are two variables. I can check if they're equal using x == y, but how can I check …

python equality