Integer Numbers in Aerospace Engineering: Properties and Range - Prof. Dana G. Haugli, Study notes of Aerospace Engineering

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

Pre 2010

Uploaded on 09/02/2009

koofers-user-f0k
koofers-user-f0k 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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) :: <list variables here>
The range of whole numbers stored in 4-byte integer variables and constants is roughly 9
101×
to 9
101×.
An alternate integer declaration uses 8 bytes:
INTEGER (kind = 8) :: <list variables here>
The range of whole numbers stored in 8-byte integers and constants is roughly 18
101× to
18
101×.

Partial preview of the text

Download Integer Numbers in Aerospace Engineering: Properties and Range - Prof. Dana G. Haugli and more Study notes Aerospace Engineering in PDF only on Docsity!

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.