# Chapter 3 Con't

Pascal Tutorial - Chapter 3

SIMPLE DATA TYPES

WHAT IS A DATA TYPE? A type in Pascal, and in several other popular programming languages, defines a variable in such a way that it defines a range of values which the variable is capable of storing, and it also defines a set of operations that are permissible to be performed on variables of that type. TURBO Pascal has eight basic data types which are predefined and can be used anywhere in a program provided you use them properly. This chapter is devoted to illustrating the use of these eight data types by defining the allowable range of values that can be assigned to them, and by illustrating the operations that can be done to variables of these types. The eight types and a very brief description follows;

   integer   Whole numbers from -32768 to 32767
byte      The integers from 0 to 255
real      Floating point numbers from 1E-38 to 1E+38
boolean   Can only have the value TRUE or FALSE
char      Any character in the ASCII character set
shortint  The integers from -128 to 127
word      The integers from 0 to 65535
longint   The integers from -2147483648 to 2147483647


Please note that four of these types of data (char, shortint, word, and longint) are not a part of the standard Pascal definition but are included as extensions to the TURBO Pascal compiler. In addition to the above data types TURBO Pascal version 5.0 and later have the following data types available;

   single     Real type with 7 significant digits
double     Real type with 15 significant digits
extended   Real type with 19 significant digits
comp       The integers from about -10E18 to 10E18


   =     equal to
<>    not equal to
>     greater than
<     less than
>=    greater than or equal to
<=    less than or equal to