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