Ordinal data type
In computer programming, an ordinal data type is a data type with the property that its values can be counted.[src] That is, the values can be put in a one-to-one correspondence with the positive integers.[src] For example, characters are ordinal because we can call 'A' the first character, 'B' the second, etc.[src] The term is often used in programming for variables that can take one of a finite (often small) number of values.[src] While the values are often implemented as integers (or similar types such as bytes) they are assigned literal names and the programming language (and the compiler for that language) can enforce that variables only be assigned those literals.[src] For instance in Pascal, one can define: var x: 1..10; y: 'a'..'z';[src]
In computer programming, an ordinal data type is a data type with the property that its values can be counted.[src] That is, the values can be put in a one-to-one correspondence with the positive integers.[src] For example, characters are ordinal because we can call 'A' the first character, 'B' the second, etc.[src] The term is often used in programming for variables that can take one of a finite (often small) number of values.[src] While the values are often implemented as integers (or similar types such as bytes) they are assigned literal names and the programming language (and the compiler for that language) can enforce that variables only be assigned those literals.[src] For instance in Pascal, one can define: var x: 1..10; y: 'a'..'z'; ==References==[src]
12 sentences · 12 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Ordinal data type." encyclopegia.org, 2025, https://encyclopegia.org/wiki/ordinal-data-type. Accessed 30 November 2026.
Chicago
"Ordinal data type." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/ordinal-data-type.
APA
encyclopegia.org. (2025). Ordinal data type. Retrieved November 30, 2026, from https://encyclopegia.org/wiki/ordinal-data-type
Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON