This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: real.c implementation


On Sun, Oct 20, 2002 at 10:00:41PM -0500, Brad Lucier wrote:
> It may give more confidence if you set up an artificial arithmetic
> that has 158-bit accuracy to be tested by paranoia.

Working on it.  There are a couple of failures.

> I don't know the answers to these questions.  Steele and White, Clinger,
> and David Gay (his code is at netlib.org) worked out provably correct methods
> to do exact binary<->decimal conversion.  All of them rely on extra-precision
> integer arithmetic for some cases.  I don't know if Moshier's code has this
> property, and I don't know if it benefits from extra intermediate precision.

Neither the current code nor the previous use arbitrary precision integer
arithmetic.  Both versions, as far as I can tell, rely on being about to
compute 10**N with lg(N) multiplications with "enough" accuracy.

> Is exact conversion a goal for gcc?

I'd say so.

I'm actually *less* concerned about binary->decimal, since for almost
all targets this is only used for debugging dumps -- fp constants are
emitted in the assembly as integer data.  There are a few hold-outs
though, so I don't want to be gratuitously wrong either.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]