home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!paladin.american.edu!darwin.sura.net!blaze.cs.jhu.edu!rhombus!wilson
- From: wilson@rhombus.cs.jhu.edu (Dwight Wilson)
- Subject: Re: Help!!! Please Read this message!?!?!?!?!...
- Message-ID: <1992Sep11.173009.12181@blaze.cs.jhu.edu>
- Sender: news@blaze.cs.jhu.edu (Usenet news system)
- Organization: The Johns Hopkins University CS Department
- References: <1992Sep9.085352.8755@vax.oxford.ac.uk> <1992Sep10.040600.27065@blaze.cs.jhu.edu> <MJN.92Sep11001608@pseudo.uucp>
- Date: Fri, 11 Sep 1992 17:30:09 GMT
- Lines: 22
-
- In article <MJN.92Sep11001608@pseudo.uucp> mjn@pseudo.uucp (Murray Nesbitt) writes:
- >
- >wilson@rhombus.cs.jhu.edu (Dwight Wilson) writes:
- >
- >>Huh? "%f" specifies a double not a float. If you think about the
- >>promotion rule you'll realize that specifying a float would be
- >>nonsensical since it is not possible for an argument to printf()
- >>to be passed as a float!
- >
- > printf( "%f...%s?\n", (float)f, "Huh?" );
- >
- >It's another matter whether you'd *want* to pass a float to printf(),
- >but it is possible.
- >
-
- This doesn't do it. f is cast to a float, the compiler sees
- that it's passing a float, doesn't see a prototype and says,
- "Hmm, better promote this to a double". Without a prototype,
- it is impossible to prevent this promotion.
-
- -Dwight
-
-