Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!thor!scjones From: scjones@thor.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: Nasty bug Message-ID: <154@thor.UUCP> Date: 4 Sep 90 14:25:14 GMT References: <2020@engage.enet.dec.com> <6441@wolfen.cc.uow.oz> Organization: SDRC, Cincinnati Lines: 24 In article , richard@iesd.auc.dk (Richard Flamsholt S0rensen) writes: > Nope. ANSI states, that floats remain floats unless the expression > contains more precise types, that is long double or double, in which > case the float in converted. Therefore, if the float is the only > parameter to a function it is *not* converted to a double in the > expression, regardless of how the function was declared. No, you've confused the "Usual Arithmetic Conversions" with the "Default Argument Promotions". The Usual Arithmetic Conversions are the rules that you state -- float stays float. Note, however, that the compiler is usually allowed to get better results than you might expect, so the old promotion to double is still allowed. When calling a function which does not have a prototype in scope, however, the Default Argument Promotions are applied to each of the arguments. These rules state that the normal Integral Promotions are performed and that all floats are converted to double, just like always. ---- Larry Jones UUCP: uunet!sdrc!thor!scjones SDRC scjones@thor.UUCP 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 When you're SERIOUS about having fun, it's not much fun at all! -- Calvin