Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dividing by zero

3 views
Skip to first unread message

C. Kagan

unread,
May 13, 1992, 7:49:36 PM5/13/92
to
Having seen a colleague of mine burn out the bearings of a FRIDEN
(electromechanical) calculator after it ran all night trying to
divide by ZERO, I provided in computer software a mechanism to
"elegantly" handle the problem without incurring the risk of
burning out the CPU.

In the "sam76" language, a macro generator, and all purpose language
developed between 1965 and the present, the divide function provides the
user with an optional argument in which will return a value as specified
by the user. This value can be just a null as in example 1 below.
It can also be a literal as shown in example 2. Or perhaps more
importantly it can be an invocation to another procedure which can
be used to correct a potential faulty input, or exit with a message &c
as illustrated in example 3.

eg: %di,144,4/={36} (dividing 144 by 4)
1. %di,144,0,/={} (returns the null string)
2. %di,144,0,INFINITY/={INFINITY} (returns literal INFINITY)
3. %di,144,0,!%procedure///={....} (invokes "procedure")

This mechanism was quite useful if not essential since the arithmetic
system in the sam76 language is of infinite precision (arbitrary) in
any number base the user desires from 2 to 32. The precision limit
is controlled solely by the size of memory allocated for the problem.

This provides an arithmetic system with no round off errors and in fact
was instrumental in preventing the early orbiter flights from landing
progressively more out of range as the number of orbits increased.

I hope this bit of history will be of use to future implementers of
divide by zero algorithms!

Claude A. R. Kagan
[...][uunet]!att!sam76u!cark

0 new messages