IBM 1130 User Manual page 510

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Real--Floating Point
The term "floating point" implies that the decimal
point is permitted to "float" among the digits in a
real number. In other words, the 1130 aritlunetic
subroutines will keep track of the location of the
decimal point and move it about to maintain the
validity of the number.
If
you multiply $1. 78 per
hour by 32.20 hours, the answer becomes $57.3160.
The decimal point "floats", thus remaining correctly
positioned at all times.
As you saw before, though, the result may not be
exact, since . 316 probably cannot be represented
exactly as a binary number. In fact, the 1. 78 and
the 32.20 were both probably inexact, too.
If
you are doing an engineering or other non-
commercial job, the answer is probably good enough;
it matters little whether the result is 57.316000 or
57.316003 or 57.315999.
If
your application is com-
merciallyoriented, however, close is not good
enough, since you are probably dealing with cash.
Because accounting balances are so important,
answers must he exact, down to the last unit
(penny, box).
It
is not that people will worry about
the penny itself, but that unbalanced totals tra-
ditionally indicate an error.
If
the face value of
600 payroll checks totals $12345.67, while the
system ts grand total is $12345.68, something may
be seriously wrong somewhere. The fact that the
net error is only one cent is immaterial; there
may be 300 people overpaid by one cent, and 299
underpaid by one cent.
Section
Subsections
Page
70
10
I
20
02
Real-- Fixed Point
To eliminate the inaccuracies described above, you
can use real arithmetic in a "fixed point" mode.
"Fixed point" means that the decimal point is kept
fixed to the right of the least significant digit, elim-
inating fractions altogether.
Earlier, you saw that 1. 78 times 32.20 gave
57.3160, an answer that probably was inexact.
If,
however, you had used real, fixed point arithmetic,
you would have multiplied
11\78.
by
31\220.,
and
obtained
571\3160.,
exactly. All three numbers,
since they involve no fractions, will be exact, not
just close. Note that the
1\
is used to locate the
implied decimal point.
This puts a slight burden on your programmer:
instead of letting the subroutines keep track of the
decimal point for him, he must now do it himself.
Using the values mentioned above, 1. 78 times
32.20 is 57.3160 (dollars), while
11\78.
times
321\20.
is
571\3160.
(ten thousandths of dollars).
In
the
latter case, you must remember that the true
decimal point is four places to the left of the one
supplied by the system.

Advertisement

Table of Contents
loading

Table of Contents