No subject

uunet!research.att.com!dmg uunet!research.att.com!dmg
Tue Mar 26 14:21:05 PST 1991


to- (uunet!validgh!numeric-interest)
from- David M. Gay
re- binary/decimal and decimal/binary conversions

I'm pleased to announce release of my paper describing
and C code implementing correctly rounded binary to
decimal and decimal to binary conversion on machines
with IEEE double-precision (P754), VAX, or IBM-mainframe
arithmetic.  Postscript for the paper is available from netlib:
ask netlibaresearch.att.com to

	send 90-10 from research/nam

To get the C code, ask netlib to

	send dtoa.c from fp

The paper's abstract:

   This note discusses the main issues in performing correctly rounded
   decimal-to-binary and binary-to-decimal conversions.  It reviews
   recent work by Clinger and by Steele and White on these conversions
   and describes some efficiency enhancements.  Computational experience
   with several kinds of arithmetic suggests that the average
   computational cost for correct rounding can be small for typical
   conversions.  Source for conversion routines that support this claim
   is available from netlib.


My argument for releasing the code was that having such a code
publicly available would be necessary to convince NCEG to require
correctly rounded conversions and that, in the long run, AT&T (and,
of course, others in the scientific computing community) would benefit
from this requirement.

In short, the idea is to get by with double precision arithmetic
where possible and to fall back on suitably high precision integer
arithmetic when double precision isn't decisive.  See the paper
for more detail.  On some machines, assembly coding the integer
arithmetic (e.g., using add-with-carry instructions and computing
double-length products) could make it run much faster than the C code.
And, as David Hough recently pointed out, large tables could help
speed the high-precision calculations too.  (It will be interesting
to see his codes when he is able to release them.  We would be happy
to add them and other such codes to netlib's fp chapter.)

-- dmg



More information about the Numeric-interest mailing list