Forgot your password?  

Not What You Meant?  There are 19 definitions for True.  Also try: Boolean or Bool.

Boolean Data Type | Research & Encyclopedia Articles

Print-Friendly   Order the PDF version   Order the RTF version
About 1 pages (234 words)
Boolean datatype Summary

 


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:

  • HOTDAY : Boolean; // declaration of variable HOTDAY as Boolean type
  • HOTDAY = (temperature > 85); // assignment of truth value to variable HOTDAY

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.

This is the complete article, containing 234 words (approx. 1 page at 300 words per page).

Ask any question on Boolean datatype and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Boolean Data Type from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

Join BookRagslearn moreJoin BookRags

Join BookRagslearn moreJoin BookRags