# Equal

In mathematics, two things are equal, when they are the same. That is, they have the same (mathematical) value, and the same mathematical properties. Mathematicians use the equals operator (Which they write as the = sign) to say this. x = y is obviously the same as y = x. Equations are equal. Inequalities are unequal.

In mathematical logic, the equivalence (equal) relation is defined as follows: Given any logic predicate P, x = y only if P(x) = P(y). In other words, if you find a predicate that has a different truth value when it is applied to either the variable x or the variable y, then the two cannot be equal.

Since a predicate is a way of describing something that is true, another way to say this is that if you can find something that is true about one variable but not true about the other variable, then they are not equal, as far as mathematical logic is concerned.

Here is a simple way of saying that: if two things are equal, anything that is true about one of them has to be true about the other one.

In geometry, the word congruence is often preferred. Numbers are equal, geometrical objects are congruent. Two shapes are congruent if one can be moved or rotated so that it fits exactly where the other one is. If you have to shrink or enlarge one of the two objects, they are not congruent. They are called similar

In Computer Science, usually, the mathematical definition is used. Very often, the comparison is written == (and the assignment, i.e. giving a value, is written =, or :=). In object-oriented languages, or languages which have pointers, there is an additional problem. Those languages contain references (which are in fact pointers). If two such references do not reference exactly the same object, they are different. a == b will be false, for this case.

For this reason, many such languages have introduced another operator (in Java, this method is called equals). This operator compares the actual values of the objects, not where the variables that reference them point to.

In social sciences, two people are equal if many of the same things are true about them. Two people who have the same amount of education and money and are the same age usually think of each other as equals. Another name for a person who is equal to another person is a peer.