Equals (computing)
|
"=", ASCII character 61.
Common names: ITU-T: equals; gets; takes. Rare: quadrathorpe; INTERCAL: half-mesh.
The equal sign is used in many programming languages, such as BASIC and C as the assignment operator. Other languages, such as Pascal, use variants such as :=
("becomes equal to") to avoid upsetting mathematicians with statements such as "x = x+1".
It is also used by itself and in compounds such as <=
, >=
, ==
, /=
, !=
for various comparison operators, and in C's +=
, *=
etc. which mimic the primitive operations of two-address code.
Many languages have different equality predicates, operators which test the equality of values. For instance, Perl has the numerical equality operator ==
and the string equality operator eq
.
Equality is a property of values, not objects. An operator which asks if two variables refer to the same data object is an identity predicate, such as Python's is
or Common Lisp's EQ
.