Boolean Data Type Encyclopedia Article

Boolean Data Type

The following sections of this BookRags Literature Study Guide is offprint from Gale's For Students Series: Presenting Analysis, Context, and Criticism on Commonly Studied Works: Introduction, Author Biography, Plot Summary, Characters, Themes, Style, Historical Context, Critical Overview, Criticism and Critical Essays, Media Adaptations, Topics for Further Study, Compare & Contrast, What Do I Read Next?, For Further Study, and Sources.

(c)1998-2002; (c)2002 by Gale. Gale is an imprint of The Gale Group, Inc., a division of Thomson Learning, Inc. Gale and Design and Thomson Learning are trademarks used herein under license.

The following sections, if they exist, are offprint from Beacham's Encyclopedia of Popular Fiction: "Social Concerns", "Thematic Overview", "Techniques", "Literary Precedents", "Key Questions", "Related Titles", "Adaptations", "Related Web Sites". (c)1994-2005, by Walton Beacham.

The following sections, if they exist, are offprint from Beacham's Guide to Literature for Young Adults: "About the Author", "Overview", "Setting", "Literary Qualities", "Social Sensitivity", "Topics for Discussion", "Ideas for Reports and Papers". (c)1994-2005, by Walton Beacham.

All other sections in this Literature Study Guide are owned and copyrighted by BookRags, Inc.

Boolean Data Type

Boolean data consist of binary information stored in data files. Boolean data are often distinguished from text, which consists of textual information stored in text files (files in which characters are represented by their ASCII codes).

Data types classify the various types of data stored in a computer, such as character, real number, integer number, floating point number, Boolean data, and pointers. Boolean data (sometimes also called binary data) are used to express the truth-values of propositions. Boolean data are of a type that computers can easily support. Computers ultimately recognize only two distinct Boolean data values, zero or FALSE and 1 or TRUE.

A simple program using Boolean data is as follows:

Above, HOTDAY is declared a Boolean variable. By definition, the only possible values of HOTDAY are 1 (TRUE) and 0 (FALSE). HOTDAY will be assigned a value of TRUE if the temperature is greater than 85, and a value of FALSE if the temperature is equal to or less than 85.

Of course, a variable of almost any data type (character, integer, or other) could be used to store "0" and "1" values and thus be made to function as a Boolean-type variable. However, employing the Boolean data type proper makes more efficient use of memory and requires less complex code.