Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!violet.berkeley.edu!jerry From: jerry@violet.berkeley.edu ( Jerry Berkman ) Newsgroups: comp.lang.fortran Subject: Re: Two Fortran Standards Message-ID: <1989Aug28.221032.21797@agate.uucp> Date: 28 Aug 89 22:10:32 GMT References: <282@unmvax.unm.edu> <303@unmvax.unm.edu> <1598@convex.UUCP> Sender: usenet@agate.uucp (USENET Administrator;;;;ZU44) Reply-To: jerry@violet.berkeley.edu ( Jerry Berkman ) Organization: University of California, Berkeley Lines: 79 In article <1598@convex.UUCP> psmith@convex.com (Presley Smith) writes: > >What about the vote in X3J3 on Document 58, 111-RRR-12, "Extra Precision >option for DATA statement", that was DEFEATED on a role call vote by 24-13? >To quote from document 111-RRR-12: > > "The committee (X3J3), in a previous action, REMOVED the Fortran 77 > permission for processor to supply extra precision. > > Comment 338.44 deplores the "extra precision" feature of Fortran 77. > > Comment 518.24 suggests that the Fortran 77 rule must remain in order > to be UPWARD COMPATIBLE from Fortran 77. ... > The extra precision rule allows the processor to chose whether to supply the precision written in the program for constants or to supply more precision. I have run the following program on several machines with different results, and on the same machine with two different compilers with different results. double precision d, extpr real x data d/0.1d0/, extpr/0.1/ x/0.1/ call compare( 'data', d, extpr, x ) d = 0.1d0 extpr = 0.1 x = 0.1 call compare( 'assignment', d, extpr, x ) end subroutine compare( str, d, extpr, x ) character str*(*) double precision d, extpr real x if( extpr.eq.d ) then print *, str, ' using extended precision' else if ( extpr.eq.x ) then print *, str, ' no extended precision' else print *, str, ' *** error ***' endif if ( d.eq.x ) print *, str, ' *** precision doesn''t matter *** ' end Results: use extra precision: DEC Fortran (VMS or Ultrix) and Sun's f77 don't use ext. precis: BSD VAX f77, IBM's VS FORTRAN, Cray's CFT & CFT77 The 1977 standard, page 9-2, lines 14-17, states about DATA statments: "if an nlist entity is of type double precision and the clist constant is of type real, the processor may supply more precision derived from the constant than can be contained in a real datum." I can find no justification for extra precision in assignment statements, although I may have overlooked it. Presley Smith continues: >The committee has voted by rejecting 111-RRR-12 to STATE that programs >which use this Fortran 77 feature will NO LONGER EXECUTE THE SAME WAY >in Fortran 8x. 111-RRR-12 was proposal to ADD this feature back into >the Fortran 8x language for upward compatibility. It was defeated. The problem already exists; we don't need to wait for Fortran 8x. A program can not select whether or not to use the extra precision feature; the processor chooses. I.e. "using" extra precision is sort of like using the fact that files are opened at their beginning. In both cases, you are depending on something not standardized. I don't really care which way the processor does it, but I want them all to do it the same way. It's ridiculous that some standard conforming programs running on a VAX will only run with DECs compiler and others only with the BSD compiler. - Jerry Berkman, Central Computing Services, U.C. Berkeley