base conversion: why beat on MIPS?
David Hough
sun!Eng!dgh
Tue Jun 12 19:14:04 PDT 1990
MIPS's base conversion routines are probably better than most, but they
are still not what I consider to be correctly-rounded, so that performance
comparisons aren't legitimate; between the extremes of "very fast and
dirty" and "correctly-rounded" lies a middle ground represented by
the MIPS code and SunOS 3.5, among others that I haven't investigated.
Why more than 17 digits? At Sun we had to support extended precision
for the Sun-3 and Sun-386, and you can't do even middling base conversion
with 64 bit integers for 64 significant bit extended precision.
So I was already into more than 64 bit integers. Once I decided to
replace the SPARC V7 extended type with the SPARC V8 quad type,
I was in really deep.
The extra trouble to support 113-bit precision and 15-bit exponents
is not much less than what it takes to do correctly-rounded base
conversion. If you want to be able to print an exact representation
for each double-precision number and read it back in with an
inexact bit set correctly, I think you need a capacity of about 1000
digits. I didn't go that far, but the only limitation is the size
of some structures.
More information about the Numeric-interest
mailing list