fortran to C converter

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Apr 25 16:18:23 AEST 1989


In article <8050 at boring.cwi.nl> dik at cwi.nl (Dik T. Winter) writes:
-In article <1989Apr24.172747.993 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
- > In article <12247 at lanl.gov> jlg at lanl.gov (Jim Giles) writes:
- > >On the Cray, doubles have 28 digits of precision, but it takes 50 (that's
- > >right - FIFTY) time as long to compute with doubles as with singles.  That
- > >doesn't even include the fact that doubles don't vectorize!  Single precision
- > >carries 14 digits of precision and is adequate for most computation.
- > Given the pervasive nature of double in C code, sounds like Cray made a bad
- > decision (or an interim one).
-Given that Cray's choice predates C, this sounds a bit strange.  Considering
-K&R and Ansi C, I would say that K&R made a bad decision (and clearly an
-interim one).

That's completely wrong -- C predates Cray Inc. and in any case the Cray
implementor of C was free to choose either the 14-digit or the 28-digit
precision to represent C "double" type.  If Giles's description of the
relative tradeoffs is correct, then I would agree that a bad choice was
made.

In an ANSI C implementation on such a computer, the new "long double"
type would be a good match for the 28-digit precision type.  I would still
advise using the 14-digit representation for doubles.



More information about the Comp.lang.c mailing list