home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / fortran / 2852 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.2 KB  |  46 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!darwin.sura.net!jvnc.net!news.edu.tw!news!debbie!daniel!linsbin
  3. From: linsbin@cc.nctu.edu.tw (Lin shyh bin)
  4. Subject: Question for C ==> Fortran
  5. Message-ID: <1992Jul28.075514.28683@debbie.cc.nctu.edu.tw>
  6. Sender: usenet@debbie.cc.nctu.edu.tw (News Sender)
  7. Organization: National Chiao Tung University
  8. X-Newsreader: Tin 1.1 PL4
  9. Date: Tue, 28 Jul 1992 07:55:14 GMT
  10. Lines: 34
  11.  
  12.     Hi, I am unfamiliar to FORTRAN, but I want to write a FORTRAN program as
  13.  
  14. like the follow C program. 
  15.   
  16.     Could anyone tell me how to transfer it on VAX FORTRAN ?
  17.  
  18.     #include <stdio.h>
  19.     #include <math.h>
  20.  
  21.     #define  MASK 0x1f800000
  22.  
  23.     union dandi {
  24.           int     i[2];
  25.           double  d;
  26.     } di;
  27.  
  28.     main()
  29.     {
  30.      float  f;
  31.      double d;
  32.      
  33.      for (f=0 ; f<1 ; f+=0.000001) {
  34.          d = (double) f;
  35.          di.d = sin(d);
  36.          if ((di.i[1] & MASK) == 0) printf("\n Sine in hex : %x", di.i[1]);
  37.      }
  38.     }
  39.  
  40.  
  41.     Thanks in advance !!
  42.  
  43.                                                Sbin  Lin
  44.                                     Usenet : u7822044@cc.nctu.edu.tw
  45.                                     Bitnet : 7822044@TWNCTU02
  46.