Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ernie.Berkeley.EDU!corbett From: corbett@ernie.Berkeley.EDU (Robert Corbett) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN 8X PRECISION Message-ID: <32496@ucbvax.BERKELEY.EDU> Date: 11 Nov 89 23:32:57 GMT References: <7563@xenna.Xylogics.COM> <8619@microsoft.UUCP> <1209@key.COM> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: corbett@ernie.Berkeley.EDU.UUCP (Robert Corbett) Organization: University of California, Berkeley Lines: 36 In article <1209@key.COM> sjc@key.COM (Steve Correll) writes: >In article , mccalpin@masig3.ocean.fsu.edu (John D. McCalpin) writes: >> I have been talking with Gary Campbell of Sun Microsystems, and his >> proposal gets to the heart of the problem. The problem with literal >> constants is that the stupid compilers insist on assigning a precision >> to them without looking at their context. Then the context is used >> later on to decide what conversions are required to obey the >> mixed-mode arithmetic rules... >> Examples: >> REAL A, B, C >> DOUBLEPRECISION X, Y, Z >> >> A = 2*B ! 2 is a REAL constant by implication >> X = Y+3.1*Z ! 3.1 is a DOUBLEPRECISION constant > >1. Using context doesn't work in examples like "CALL XYZ(3.5)". > > Until you start using modules, the compiler cannot know the type of the dummy > argument. The example CALL XYZ(3.5) is not a problem. Since there is no interface block for XYZ, the type of the parameter is REAL. Therefore, the assignment to the dummy argument is handled as an assignment to a REAL variable. I have not seen Gary Campbell's proposal yet, but I suspect I shall see it soon. In the December 1982 issue of SIGPLAN Notices and in the January 1983 issue of SIGNUM Newsletter, there is an article "Enhanced Arithmetic for Fortran," which describes in detail a similar proposal. The author describes a scheme, originally proposed by W. Kahan, for assigning accuracies to components of expressions in a way that produces intuitively correct results in an efficient manner. The scheme could easily be extended to Fortran 8x. Yours truly, Robert Paul Corbett