[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updated Integers module



> Date: Thu, 2 Jul 98 05:54:03 EDT
> From: Mike Griebling <grieblm@trt.allied.com>
> 
> I've attached an updated Integers module with a small bug fix (10*0
> wouldn't work) ;-).  I've also included a small test program along
> with some expected output.

Has been added to the source tree.  Bootstrapping works with your
updated LReal modules.

> One other point: would anyone object to using the Integers module in
> place of the LongInts module in LONGREAL conversion routines?
> LongInts was a stop-gap measure until a real multi-precision integer
> module was available.  If Integers were used, LongInts could be
> removed from the OOC library.

No and yes.  No, removing helper modules from the library set is
good.  Yes, because the LongInts stuff works on the stack, while
Integers has its values on the heap.  The latter is much more costly
than the former.

This reminds me of a question I have for quite some time now.  A paper
I read once claimed, that radix conversion from base 2 to base 10 can
be done efficiently (and of course precise) if you have an floating
point representation with higher precision.  For example, to convert a
64 bit IEEE double number into a base 10 representation, all you need
is an 80 bit IEEE extended number.  I believe the claim and the
algorithm can be found in the fp classic

`What Every Computer Scientist Should Know About Floating-Point Arithmetic'
David Goldberg
ACM Computing Surveys, Vol. 23, No. 1, March 1991, pp. 5-48

My question: why do you need a 340 byte data type (LongInt*=ARRAY 170
OF INTEGER) for this task?

-- mva