In this chapter we will see how the C programming language handles a wider range of numerical data types than the simple integers we have studied so far. For the various data types we will see how to read them in, how to print them out, how to write constant values and how expressions involving numbers of more than one type are evaluated.
There are three basic data types. The notion of a data type reflects the possibility of the 1s and 0s stored in a computer memory location being interpreted in different ways. For full details an appropriate text on computer architecture should be consulted.
The first basic data type we shall consider is the floating point number. Floating point numbers provide a way of storing very large and very small numbers including fractions. There are often several different ways of storing floating point numbers offering a choice of precision or number of significant digits. High precision storage of floating point numbers uses up more computer memory and results in slower arithmetic. Floating point numbers are sometimes called real numbers although mathematicians would object to this usage, there being many numbers that cannot be stored exactly as floating point numbers.
Finally the character data type provides a way of storing and manipulating the internal codes that represent the symbols that appear on output devices and the symbols that are engraved on keyboard keytops.
The C programming language does not support the fixed point and binary coded decimal data types widely used in commercial programming to store monetary information.