Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!iuvax!purdue!i.cc.purdue.edu!h.cc.purdue.edu!s.cc.purdue.edu!ags From: ags@s.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.fortran Subject: Re: CDC FORTRAN trivia questions Keywords: arithmetic if logical Message-ID: <3616@s.cc.purdue.edu> Date: 31 Oct 88 15:33:27 GMT References: <1196@helios.ee.lbl.gov> Reply-To: ags@s.cc.purdue.edu.UUCP (Dave Seaman) Organization: Purdue University Lines: 47 In article <1196@helios.ee.lbl.gov> mike@quench.lbl.gov (Michael Helm) writes: [Re: Ancient CDC Fortran and the two-branch logical IF] [This is my corrected posting. I have cancelled an incorrect earlier posting. If you see another posting from me on this subject, ignore it.] > LOGICAL IRON > . > . > . > IF(IRON)4,9 > >What logical state will IRON be in for #4 to be executed, & for #9 >to be executed? The Fortran 77 equivalent of this CDC-ism is: IF (IRON) THEN GO TO 4 ELSE GO TO 9 ENDIF CDC compilers also recognized a two-branch arithmetic IF of the form, IF (aexp) 10,20 where "aexp" is an arithmetic expression. The Fortran 77 equivalent is: IF (aexp .NE. 0) THEN GO TO 10 ELSE GO TO 20 ENDIF >How were(are) logical values represented on old(current) >CDC hardware or in CDC FORTRAN programs? The representation of logical values is a software concept, not a hardware concept. I can't imagine why you would need to know the representation chosen by a particular Fortran compiler, but if I remember correctly, the usual convention was to represent .TRUE. as -1 and .FALSE. as zero. Some of the very old CDC compilers used a different convention. -- Dave Seaman ags@j.cc.purdue.edu