Xref: utzoo comp.unix.wizards:11701 comp.lang.c:13244 Path: utzoo!utgpu!water!watmath!clyde!att!icus!noether!mozart!rosalia From: rosalia@mozart.UUCP (Mark Galassi) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: Problem with printf() Message-ID: <338@mozart.UUCP> Date: 11 Oct 88 02:16:50 GMT References: <504@imec.UUCP> Reply-To: rosalia@mozart.UUCP (Mark Galassi) Organization: Mark Galassi Research Lines: 19 In article <504@imec.UUCP> croes@imec.UUCP (Kris Croes) writes: >A little program containing a big problem. > int i = 17; > float f = 17.0; > printf("%d %f\n",i,i); /*1*/ > printf("%d %f\n",f,f); /*2*/ > } Isn't it the case that the compiler promotes a float to a double (64bits on a VAX probably), thus making the stack different from what you thought it would be. I believe that that must be the case, because when you call sin(x) and x is just a float, it must be coerced to a double since the sin() func is written to take a double. -- Mark Galassi rosalia@mozart.UUCP These opinions are mine and should be everybody else's :-)