From dick@csci.csusb.edu  Fri May  5 17:04:42 2000
Received: from silicon.csci.csusb.edu (silicon.csci.csusb.edu [139.182.38.1])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id RAA21497
	for <prolog@swi.psy.uva.nl>; Fri, 5 May 2000 17:04:41 +0200 (MET DST)
From: dick@csci.csusb.edu
Received: from blaze.csci.csusb.edu (blaze.csci.csusb.edu [139.182.38.10])
	by silicon.csci.csusb.edu (8.9.1/8.9.1) with ESMTP id IAA04858;
	Fri, 5 May 2000 08:03:41 -0700 (PDT)
	(envelope-from dick@csci.csusb.edu)
Received: by csci.csusb.edu id HAA14152; Fri, 5 May 2000 07:53:16 -0700 (8.9.1 Berkeley Sendmail)
Date: Fri, 5 May 2000 07:53:16 -0700
Message-Id: <200005051453.HAA14152@csci.csusb.edu>
To: nangelop@csd.abdn.ac.uk, timm@csee.wvu.edu
Subject: Re: handling small numbers (fwd)
Cc: prolog@swi.psy.uva.nl

Historically Van Neuman promulgated floating point as a convinient 
approximation for scientific calculations.   At the time, a scientist 
would aften work to 6 decimal places and only need four of them.
Floating point arithmetic should not be used when the
right answer is more important than convenience.  Three special cases:
	safety critical -- Wichman had a paper on the risks in the Brittish
		computer society(BCS) Journal a few years ago.
	Number theory.
	Money.

For money you usually need an integer+2digits.  For safety critical
fixed point binary with very carefully reasoned out scaling. (These are forgotten
skills, sadly)

For number theory you often need "infinite precsion" arithmetic.  Essentially
a package defining precise algorithms for addition, subtraction and multiplication.
A simple test is to calculate the precise value of factorial 100.
Large number arithmetic will not be fast in any language.
I recall one simple calculation that ran for 90 days using precise
multi-length arithmetic (written in Algol60 by the way).

For some applications other representations are useful.  Occassionally
a little mathematics can do better than a lot of calculation.

As the old joke nearly said:
  you can have it fast, convenient, or right: pick two.

dick

