next up previous contents
Next: What is Real? Up: Problem Solving with Numbers Previous: How to Turn it   Contents


Real Numbers

Integer is a very useful type. Variables of this type can be used for counting and represent positive as well as negative quantities. However, in real life, many numbers are not integers. For example, the value of $\pi$ is an irrational number. Three quarter of an inch is 0.75 inch, which is not an integer, either.

Pascal provides another type, in addition to Integer, to represent numbers that are not integers. This type is predefined (like Integer) and has a name of Real. To declare the x is a real number, for example, you can do so with the following code:

var
  x : Real;



Subsections

Tak Auyeung 2003-12-03