Fixed Point
regardless of
whether
the
factors
are
9.37 x 44.2, 93.7 x .442, or 937 x 4.42, etc.
It
would normally
be
the
programmer's responsibility to
be
cognizant of
the
deci-
mal
point
location
during
and
after
the
calculation
and
to
arrange
the
program
accordingly.
The
processing of
numbers
expressed
in
ordinary
form (e.g., 427.93456,
0.0009762, 5382,
-623.147,
3.1415927, etc.)
can
be
accomplished
on
a
computer
only
with
extensive analysis to determine
the
size
and
range
of
intermediate
and
final results. This analysis
and
subsequent
number
scaling frequently requires
a larger
percentage
of
the
total time
needed
to solve
the
problem
than
is
required
by
the
actual calculation. Furthermore,
number
scaling requires complete
and
accurate information
regarding
the
bounds
on
the
magnitude
of all
numbers
that
come into
the
computation (input, intermediate,
output).
Since
it
is
not
always
possible to
predict
the
size of all numbers
in
a given calculation, analysis
and
number
scaling is sometimes impractical.
To
alleviate this
programming
problem, a system is
used
in
FORTRAN
in
which
information
regarding
the
magnitude
of all
numbers
accompanies
the
quantities
in
the
calculation. All numbers are
represented
in
a
standard,
predetermined
for-
mat
which instructs
the
computer
in
an orderly
and
simple fashion as to
the
location of
the
decimal point.
With
this method, quantities
which
range
from
minute fractions having
many
decimal places to large
numbers
having
many
in-
teger places
may
all
be
handled. This system is called "floating
point
arithmetic."
The
notation
used
in
floating
point
arithmetic is an
adaptation
of
the
scien-
tific notation.
That
is,
the
decimal
point
of all
numbers
is assumed to
be
at
the
left of
the
high-order
nonzero digit.
(This
is often
referred
to
as
"normalizing"
the
number.)
Hence, all quantities
may
be
thought
of as a decimal fraction times
a power of ten.
427.93456 as .42793456 X 10
3
and
0.0009762 as .97620000 X 10-
3
where
the
fraction is called
the
mantissa,
and
the
power
of ten, indicating
the
number
of places
the
decimal point was shifted,
is
called
the
exponent.
In
floating
point
calculations,
each
quantity
operated
upon
is expressed as
a 10-digit
number
consisting of an 8-digit mantissa,
and
a 2-digit exponent.
The
magnitude
of
the
number
thus expressed
must
be
zero or
must
lie
between
10-
100
and
10
99
•
The
mantissa consists of
the
leftmost
eight
digits of
the
floating
point
num-
ber.
The
decimal
point
is always assumed to lie immediately to
the
left of
the
high-
order mantissa digit.
The
range of
the
mantissa is
between
.10000000
and
.99999999.
The
exponent represents
the
power of
ten
used
to specify
the
location of
the
decimal
point
in
the
original number.
The
sign
and
magnitude
of
the
exponent
are
determined
by
the
number
of places
the
decimal
point
is shifted
in
order
to place
it
to
the
left of
the
high-order nonzero digit.
The
direction of shift determines
the
sign of
the
exponent; positive for left, negative for right.
The
following examples demonstrate
the
conversion of numbers
in
ordinary
form to a floating
point
notation.
Nuuber
Floating
Point
Form
123.45678
.00765438
-.12348693
-.00000070
.12345678 X 10
3
.76543800 X 10-
2
-.12348693
X
100
-.70000000
X 10-
6
Quantities
used
in
a
FORTRAN
program
may
also
be
expressed
in
fixed
point
form.
A fixed
point
number
is
an
ordinary whole
number,
without
a decimal point, con-
sisting of
the
digits 0
through
9.
Writing
the
1620
FORTRAN
Program 13