delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-Id: | <200312041543.hB4Fhr6u021146@p-chan.cognex.com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: EOF error |
In-Reply-To: | Message from Fred_Smith@computrition.com |
of "Thu, 04 Dec 2003 09:02:52 EST." <85256DF2 DOT 004CB45F DOT 00 AT cinote DOT computrition DOT com> | |
Mime-Version: | 1.0 |
Date: | Thu, 04 Dec 2003 10:43:53 -0500 |
From: | Don Koch <koch AT cognex DOT com> |
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 AT cognex DOT 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |