This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: EOF error


As we move into the realm of "OT".

"Kooser, Ara S" said:
>    PROGRAM TEMP
> *********************************************************
> *This program converts Celsius to Farenheit           *
> *                                *
> *The variable used is:                      *
> *  DEGC : degress celsius              *
> *********************************************************
>
>    REAL DEGC, DEGF
>    PRINT * , 'ENTER THE TEMPERATURE IN DEGRESS C:'
>         READ * , DEGC
>    DEGF = 9 / 5 * DEGC + 32
>    PRINT * , 'DEGRESS FARENHEIT:' , DEGF
>         END
>
> I compiled it with this command
>
> gcc -o projec -c projec.f

Fred_Smith said:
> Besides the fact that this program does not produce correct results (entering
> "-40" produces output of "-8" which certainly is incorrect), is it also not
> an error to be trying to compile a FORTRAN program with gcc? Should he not be
> using g77 instead? 

"gcc" will figure out what to do based on the suffix.  The reason it produces
incorrect output is becasue "9 / 5" => 1 (integer roundoff).  Use floats.

-- 
Don Koch
koch@cognex.com
----
Not speaking for Cognex Corporation.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]