home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!darwin.sura.net!jvnc.net!news.edu.tw!news!debbie!daniel!linsbin
- From: linsbin@cc.nctu.edu.tw (Lin shyh bin)
- Subject: Question for C ==> Fortran
- Message-ID: <1992Jul28.075514.28683@debbie.cc.nctu.edu.tw>
- Sender: usenet@debbie.cc.nctu.edu.tw (News Sender)
- Organization: National Chiao Tung University
- X-Newsreader: Tin 1.1 PL4
- Date: Tue, 28 Jul 1992 07:55:14 GMT
- Lines: 34
-
- Hi, I am unfamiliar to FORTRAN, but I want to write a FORTRAN program as
-
- like the follow C program.
-
- Could anyone tell me how to transfer it on VAX FORTRAN ?
-
- #include <stdio.h>
- #include <math.h>
-
- #define MASK 0x1f800000
-
- union dandi {
- int i[2];
- double d;
- } di;
-
- main()
- {
- float f;
- double d;
-
- for (f=0 ; f<1 ; f+=0.000001) {
- d = (double) f;
- di.d = sin(d);
- if ((di.i[1] & MASK) == 0) printf("\n Sine in hex : %x", di.i[1]);
- }
- }
-
-
- Thanks in advance !!
-
- Sbin Lin
- Usenet : u7822044@cc.nctu.edu.tw
- Bitnet : 7822044@TWNCTU02
-