Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!ames!pacbell!att!oucsace!bchurch From: bchurch@oucsace.cs.OHIOU.EDU (Bob Church) Newsgroups: comp.sys.apple Subject: Re: hyperC K&R standard? Summary: Floating point problems Message-ID: <1133@oucsace.cs.OHIOU.EDU> Date: 18 Feb 90 18:39:48 GMT References: <3452@plains.UUCP> Distribution: usa Organization: Ohio University CS Dept., Athens Lines: 36 > > The following program is taken verbatium from THE C PROGRAMMING > LANGUAGE, by Brian W. Kernigan and Dennis M. Ritchie. > main() > { > int lower, upper, step; > double fahr, celsius; > > while (fahr <= upper) { > celsius = (5.0/9.0) * (fahr-32.0); > printf("%4.0f %6.1f\n", fahr, celsius); > } [various lines of the program deleted] > Can anyone tell me why this will not compile under PRODOS > HyperC? > > > Ames Grisanti I don't use Hyperc but it's a pretty safe guess that your problem lies in using floating point integer. Doubles are fp and if a compiler/linker supports them at all you generally have to use special libraries etc. For the sake of experimentation change the doubles to int and change the numbers containing decimal places to integers. The results won't be correct but this will help narrow down the problem. ******************************************************************** * * * bob church bchurch@oucsace.cs.ohiou.edu * * * * If economics isn't an "exact" science why do computers crash * * so much more often than the stock market? * * bc * ********************************************************************