ordinal data type
   HOME

TheInfoList



OR:

In computer programming, an ordinal data type is a
data type In computer science and computer programming, a data type (or simply type) is a set of possible values and a set of allowed operations on it. A data type tells the compiler or interpreter how the programmer intends to use the data. Most progra ...
with the property that its values can be counted. That is, the values can be put in a one-to-one correspondence with the positive integers. For example, characters are ordinal because we can call 'A' the first character, 'B' the second, etc. The term is often used in programming for variables that can take one of a finite (often small) number of values. While the values are often implemented as integers (or similar types such as bytes) they are assigned
literal Literal may refer to: * Interpretation of legal concepts: ** Strict constructionism ** The plain meaning rule (a.k.a. "literal rule") * Literal (mathematical logic), certain logical roles taken by propositions * Literal (computer programmin ...
names and the programming language (and the compiler for that language) can enforce that variables only be assigned those literals. For instance in Pascal, one can define: var x: 1..10; y: 'a'..'z'; Data types {{Compu-prog-stub