home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3148 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  1.2 KB

  1. Path: sparky!uunet!olivea!decwrl!purdue!mentor.cc.purdue.edu!ags
  2. From: ags@mentor.cc.purdue.edu (Dave Seaman)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: Does your f77 compiler accepts this?
  5. Message-ID: <BtJyIM.1p2@mentor.cc.purdue.edu>
  6. Date: 25 Aug 92 18:39:57 GMT
  7. References: <2873@tansei1.tansei.cc.u-tokyo.ac.jp> <BURLEY.92Aug24145148@geech.gnu.ai.mit.edu> <1992Aug25.153937.26559@newshost.lanl.gov>
  8. Organization: Purdue University Computing Center
  9. Lines: 34
  10.  
  11. In article <1992Aug25.153937.26559@newshost.lanl.gov> ttw@beta.lanl.gov (Tony Warnock) writes:
  12.  
  13. >      WRITE (*,*) (x,x) is legal. It calls for the printing of the
  14. >      COMPLEX variable with real and imaginary parts both equal to x.
  15.          
  16. >       ANSI X3.9-1978 13.6.2 line 6 Page 13-16
  17.  
  18. The paragraph in question is concerned with complex *constants*.
  19.  
  20.     (2.0,3.0) is an example of a complex constant.
  21.     (X,X) is not a constant, and is not legal Fortran.
  22.  
  23. If X is a real number, then the complex number X + iX is given in Fortran by
  24.  
  25.     CMPLX(X,X)
  26.  
  27. where CMPLX is a required intrinsic function in the ANSI standard.
  28.  
  29. Each of the statements
  30.  
  31.     WRITE (*,*) X
  32.     WRITE (*,*) (X)
  33.     WRITE (*,*) CMPLX(X,X)
  34.  
  35. is legal Fortran, but
  36.  
  37.     WRITE (*,*) (X,X)
  38.  
  39. is not.
  40.  
  41.  
  42. -- 
  43. Dave Seaman
  44. ags@seaman.cc.purdue.edu
  45.