home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / arch / 11672 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!rutgers!igor.rutgers.edu!zodiac.rutgers.edu!leichter
  2. From: leichter@zodiac.rutgers.edu
  3. Newsgroups: comp.arch
  4. Subject: Re: Any use for Branch if Even/Odd ?
  5. Message-ID: <1992Dec15.143224.1@zodiac.rutgers.edu>
  6. Date: 15 Dec 92 19:32:24 GMT
  7. References: <endecotp.723992157@cs.man.ac.uk> <1992Dec12.143116.17635@infodev.cam.ac.uk> <1992Dec14.085714.62016@cc.usu.edu> <Bz9C2z.Cno@pgroup.com>
  8. Sender: news@igor.rutgers.edu
  9. Organization: Rutgers University Department of Computer Science
  10. Lines: 21
  11. Nntp-Posting-Host: pisces.rutgers.edu
  12.  
  13. In article <Bz9C2z.Cno@pgroup.com>, lfm@pgroup.com (Larry Meadows) writes:
  14.     > I haven't seen this mentioned -- in VMS Fortran, logicals are TRUE
  15.     > if odd and FALSE if even.  Someone said that BLISS was the same way.
  16.     > Of course, this gives fits when mixing Fortran and C, or trying to
  17.     > retain VMS Fortran compatibility on non-VMS systems.
  18.  
  19. What ARE you talking about?  FORTRAN has a first-class Boolean datatype, which
  20. has exactly two values in its value space:  .TRUE. and .FALSE. .  Boolean
  21. values are neither odd nor even; they are just plain not arithmetic.  You
  22. can't use arithmetic values in Boolean contexts, nor can you use Booleans in
  23. arithmetic contexts.  The internal representation of a Boolean is simply not
  24. observable, unless you play inherently non-portable games (like overlaying an
  25. INTEGER with a LOGICAL).
  26.  
  27. The standard internal representations for truth and falsehood in both VAX C
  28. and FORTRAN are 1 and 0.  Any function in either that returns a Boolean will
  29. be treated by the other has having the appropriate meaning.
  30.  
  31. Don't judge the whole world by C standards; it'll just give you a headache.
  32.  
  33.                             -- Jerry
  34.