GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — Ordinal data type - Wikipedia

Not to be confused with Ordinal data (statistics).
icon
This article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Ordinal data type" – news · newspapers · books · scholar · JSTOR
(December 2009) (Learn how and when to remove this message)

In computer programming, an ordinal data type is a data type 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.[1] 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 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';

References

  1. ↑ Jensen, Kathleen (1991). Pascal User Manual and Report: ISO Pascal Standard. A. B. Mickel, J. F. Miner, Niklaus Wirth (4th ed.). New York, NY: Springer New York. ISBN 978-1-4612-4450-9.


Stub icon

This computer-programming-related article is a stub. You can help Wikipedia by adding missing information.

  • v
  • t
  • e
Retrieved from "https://en.wikipedia.org/w/index.php?title=Ordinal_data_type&oldid=1311838383"
Categories:
  • Data types
  • Computer programming stubs
Hidden categories:
  • Articles needing additional references from December 2009
  • All articles needing additional references
  • All stub articles
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.