Equals Sign - Usage in Mathematics and Computer Programming

Usage in Mathematics and Computer Programming

In mathematics, the equals sign may express a simple statement of fact (x = 2), a definition (let x = 2), or a condition (if x = 2 then...).

The first important computer programming language to use the equals sign was the original version of Fortran, FORTRAN I, designed in 1954 and implemented in 1957. In Fortran, "=" serves as an assignment operator: X = 2 sets the value of X to 2. This somewhat resembles the use of "=" in a mathematical definition, but with different semantics: the expression following "=" is evaluated first and may refer to a previous value of X. For example, the assignment X = X + 2 increases the value of X by 2.

A rival programming-language usage was pioneered by the original version of ALGOL, which was designed in 1958 and implemented in 1960. ALGOL included a relational operator that tested for equality, allowing constructions like if x = 2 with essentially the same meaning of "=" as the conditional usage in mathematics. The equals sign was reserved for this usage.

Both usages have remained common in different programming languages into the early 21st century. As well as Fortran, "=" is used for assignment in such languages as C, Perl, Python, awk, and their descendants. But "=" is used for equality and not assignment in the Pascal family, Ada, Eiffel, APL, and other languages.

A few languages, such as BASIC and PL/I, have used the equals sign to mean both mean assignment and equality, distinguished by context. However, in most languages where "=" has one of these meanings, a different character or, more often, a sequence of characters is used for the other meaning. Following ALGOL, most languages that use "=" for equality use ":=" for assignment, although APL, with its special character set, uses a left-pointing arrow.

Fortran did not have an equality operator (it was only possible to compare an expression to zero, using the arithmetic IF statement) until FORTRAN IV was released in 1962, since when it has used the four characters ".EQ." to test for equality. The language B introduced the use of "==" with this meaning, which has been copied by its descendant C and most later languages where "=" means assignment.

Read more about this topic:  Equals Sign

Famous quotes containing the words usage, mathematics, computer and/or programming:

    Girls who put out are tramps. Girls who don’t are ladies. This is, however, a rather archaic usage of the word. Should one of you boys happen upon a girl who doesn’t put out, do not jump to the conclusion that you have found a lady. What you have probably found is a lesbian.
    Fran Lebowitz (b. 1951)

    Mathematics alone make us feel the limits of our intelligence. For we can always suppose in the case of an experiment that it is inexplicable because we don’t happen to have all the data. In mathematics we have all the data ... and yet we don’t understand. We always come back to the contemplation of our human wretchedness. What force is in relation to our will, the impenetrable opacity of mathematics is in relation to our intelligence.
    Simone Weil (1909–1943)

    The archetype of all humans, their ideal image, is the computer, once it has liberated itself from its creator, man. The computer is the essence of the human being. In the computer, man reaches his completion.
    Friedrich Dürrenmatt (1921–1990)

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)