Comparison Article Index for
Comparison
Articles about
Comparison
Website Links For
Comparison
 

Information About

Comparison





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 Algorithm s, the efficiency of comparison code is critical since it is one of the major factors of sorting performance.

Sometimes, particularly in Object-oriented Programming , the comparison raises questions of Datatype s and Inheritance , Equality and Identity . It is often necessary to distinguish between:
  • 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


Sameness and difference can be relative or graduated as well as absolute, particularly in Fuzzy Logic , Artificial Intelligence , Signal Processing , Lossy Data Compression and Pattern Recognition .

''See also'': Regular Expression


IN GRAMMAR



Comparison, in Grammar , is a property of Adjective s and Adverb s in most Language s; it describes systems that distinguish the degree to which the modifier modifies its complement.

English , due to the complex Etymology of its Lexicon , has two parallel systems of comparison. One involves the Suffix es ''-er'' (the " Comparative ") and ''-est'' (the " Superlative "). These inflections are of Germanic 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 Inflection s 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

  • ''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 for a discussion on how this sort of imprecise language might lead to similarly imprecise thought.


IN MATHEMATICS

See:


ACADEMIC FIELDS FOCUSING ON COMPARISON




SEE ALSO