
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to integer numbers, their mathematical properties during division, and the range of whole numbers that can be assigned to integer variables in aerospace engineering. It explains the concept of integer division and its potential uses and risks.
Typology: Study notes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

D. Haugli Aer E 160 Aerospace Engineering 2/4/2005 Integer Numbers, Page 1 Iowa State University
Integer Numbers
An integer is a positive or negative whole number with no decimal point or commas. If a, b and c are integer variables, they would be declared as,
INTEGER :: a, b, c
List variables one after the other in the declaration separated by commas.
Integers have special mathematical properties during division, since they can have no decimal values. For example, if a = 1 and b = 2, and if c = a / b, then the mathematical value of c would be 0.5, but since c is an integer, the .5 is truncated, leaving c = 0 (no decimal). This unique property of integers is called integer division. Integer division can introduce accidental errors into computer solutions, so be certain to avoid unintentionally dividing an integer number by another number (integer or real - see below).
Integer division can sometimes be used to advantage however....more will be said about this as specific problems arise during Aer E 160 and 161.
The range of whole numbers that can be assigned to INTEGER variables and constants is limited. These limitations are related to the number of bytes required to save an integer in memory or to operate on an integer in the central processing unit. The default size of an integer (i.e., in an INTEGER declaration) is four bytes. An equivalent way to declare this size integer would be,
INTEGER (kind = 4) ::
The range of whole numbers stored in 4-byte integer variables and constants is roughly − 1 × 109
to 1 × 109.
An alternate integer declaration uses 8 bytes:
INTEGER (kind = 8) ::
The range of whole numbers stored in 8-byte integers and constants is roughly − 1 × 1018 to
1 × 10 18.