Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!cccm001 From: cccm001@ut-emx.UUCP (Tom Linsley) Newsgroups: comp.lang.fortran Subject: Re: CDC FORTRAN trivia questions Summary: Ancient CDC logic Keywords: arithmetic if logical Message-ID: <7523@ut-emx.UUCP> Date: 31 Oct 88 23:23:21 GMT References: <1196@helios.ee.lbl.gov> <3616@s.cc.purdue.edu> Organization: The University of Texas at Austin, Austin, Texas Lines: 31 Some further trivia relating to the CDC two-branch IF and 6600 logic: The values .TRUE. and .FALSE., when assigned to a variable, are represented as a (60-bit) word with all bits set (-0) and all bits clear (+0), respectively. Later CDC compilers (FTN, MNF) checked the sign bit (2**59), and .TRUE. was high, .FALSE. low. The venerable RUN compiler used a different convention, whereby a word with no bits set (+0) was .FALSE., and _any_other_value_ was .TRUE. This convention made possible some peculiarly illogical logical behaviors, in that both "X" and ".NOT. X" could be true simultaneously, if "X" had been given some nonzero (or "non-logical") value (i.e., neither +0 nor -0). Remember that this compiler dates from a time when "strong typing" meant pounding hard on the keypunch. As an aside, negative zero was assigned to a variable read from a blank field (rather than a field containing a zero), and the test for the blank (often used for missing data) was IF ( .NOT. X ) T,F where the "false" branch indicated a negative zero (arithmetic blank) value. IF ( X .AND. (X .EQ. 0) ) was also sometimes used for this check. -- Tom Linsley University of Texas Computation Center cccm001@emx.cc.utexas.edu