home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / fortran / 4426 < prev    next >
Encoding:
Text File  |  1992-11-23  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
  3. From: jlg@cochiti.lanl.gov (J. Giles)
  4. Subject: Re: How does one return a logical value...???
  5. Message-ID: <1992Nov23.191651.18561@newshost.lanl.gov>
  6. Sender: news@newshost.lanl.gov
  7. Organization: Los Alamos National Laboratory
  8. References: <kf2iy2_00YUo8INXQF@andrew.cmu.edu> <BxzC1x.n0s@news.cso.uiuc.edu> <1992Nov20.210324.3906@draco.macsch.com>
  9. Date: Mon, 23 Nov 1992 19:16:51 GMT
  10. Lines: 24
  11.  
  12. In article <1992Nov20.210324.3906@draco.macsch.com>, dnl@convex.is.macsch.com (David Lombard) writes:
  13. |> >[...]
  14. |> 
  15. |> The following statement is fairly clear:
  16. |> 
  17. |>     IF( A.EQ.B .EQV. C.EQ.D ) ...
  18. |> 
  19. |> What would you do with this phantom?
  20. |> 
  21. |>     IF( A.EQ.B .EQ. C.EQ.D ) ...
  22.  
  23. Well, of course you could have written it:
  24.  
  25.       IF((A.EQ.B) .EQ. (C.EQ.D)) ...
  26.  
  27. Frankly, I'd have put in the extra parenthesis even if you'd used
  28. the .EQV. operator.  Outside the *basics*, precedence is not to be
  29. relied upon (in some languages, people are advocating the elimination
  30. of precedence even for the basics - add, vs. multiply for example).
  31. A few extra parenthesis to reinforce your intent with lesser-used
  32. operators seems sensible.
  33.  
  34. -- 
  35. J. Giles
  36.