Science Fair Project Encyclopedia
In computer programming
In computer programming, when one compares the two values x and y, a negative number often indicates x < y, zero x == y and a positive number x > y. Even when two values are not integers, e.g. literal strings, this convention is largely adopted. For example, strcmp returns -1, 0, or 1 according to the lexicographical order, and qsort expects the comparison function to return values according to this convention. This is because it is efficient to do the subtraction x - y resulting in the directional signs above. In sorting algorithms, the efficiency of comparison code is critical since it is one of the major factors of sorting performance.
- two objects with different datatypes both related to another datatype, e.g. an orange and a lemon, both being citrus fruit
- two different objects of the same type, e.g. two hands
- two objects being equal but distinct, e.g. two $10 banknotes
- two different references to the same object, e.g. two nicknames for the same person
See also: regular expression
English, due to the complex etymology of its lexicon, has two parallel systems of comparison. One involves the suffixes -er (the "comparative") and -est (the "superlative"). These inflections are of Indo-European origin, and are cognate with the Latin suffixes -ior and -issimus. These inflections are typically added to shorter words, words of Anglo-Saxon origin, and borrowed words that have been fully assimilated into the English vocabulary. Usually the words that take these inflections have fewer than three syllables. This system contains a number of irregular forms, some of which, like good, better, best, contain suppletive forms. These irregular forms include:
good better best well better best bad worse worst far farther farthest far further furthest little less(er) least (also has regular forms) many more most
The second system of comparison in English appends the grammatical particles more and most, themselves the irregular comparatives of many, to the adjective or adverb being modified. This series can be compared to a system containing the diminutives less and least. This system is most commonly used with words of French or Latin derivation; adjectives and adverbs formed with suffixes other than -ly (e.g. beautiful); and with longer, technical, or infrequently used words. Knowing which words fall into which system is a highly idiomatic issue in English syntax. Some words require the suffixing system: e.g. taller is required; *more tall is not idiomatic English. Some words (e.g. difficult) require more and most. Some words (e.g. polite) can be used with either system; curiously, while polite can go either way, the derived word impolite requires more and most. The general rule is that words with one syllable require the suffix, words with three or more syllables require more or most and words with two syllables can go either way.
A perennial issue in English usage involves the comparison of so-called "absolute" adjectives, adjectives that logically do not seem to admit of comparison. There are many such adjectives - generally adjectives that name qualities that are either present or absent: nothing is *"more Cretaceous" or *"more igneous" than anything else. Other examples include perfect and parallel, which name qualities that are inherently superlative: if something is perfect, there can be nothing better, so it does not make sense to describe one thing as *"more perfect" than something else. Nonetheless, such forms often do make sense in a specific context. If one fossil is from the very beginning of the Cretaceous period - the transition into the Cretaceous period - while another is from the middle of that period, then the latter might be described as "more Cretaceous" than the former. If one solution to a problem leaves everyone happy, then it might be regarded as a perfect solution, even if another solution leaves everyone even happier; in this case, the latter might be characterized as "more perfect" than the latter. In general, terms like perfect and parallel cannot ever apply exactly to things in real life, so they are commonly used to mean nearly perfect, nearly parallel, and so on; and in this (inexact) use, more perfect (i.e., more nearly perfect, closer to perfect) and more parallel (i.e., more nearly parallel, closer to parallel) do seem to make sense. See Sapir-Whorf hypothesis for a discussion on how this sort of imprecise language might lead to similarly imprecise thought.
- Category theory
- Class (set theory)
- Congruence (geometry)
- Equivalence relation, Equality (mathematics), Inequality, Logical equivalence, Congruence relation, Equivalence class
- Order theory
- Proportionality (mathematics)
- Similarity (mathematics)
Academic fields focusing on comparison
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details