Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: re: how has C bitten you? Message-ID: <5875@utzoo.UUCP> Date: Wed, 14-Aug-85 13:46:17 EDT Article-I.D.: utzoo.5875 Posted: Wed Aug 14 13:46:17 1985 Date-Received: Wed, 14-Aug-85 13:46:17 EDT References: <505@brl-tgr.ARPA>, <16150@watmath.UUCP> Organization: U of Toronto Zoology Lines: 17 > I thought that the implicit promotion of float to double on passing > an argument was one of the things that was going away with the > new C standard. ... Not quite. Making it go away would break many, many programs. What has actually happened is a bit more complex. Implicit float->double in most contexts is now at the compiler's discretion, i.e. a compiler for a Cray would probably opt to do it only if asked. Function calls are messier. If there's a function prototype in scope, then conversions get done to the types in the prototype, so your function prototypes can all just say "float" for the parameters in question and there will be no implicit widening to double. If there is *no* function prototype in scope, or if the prototype ends with the "..." syntax for a variable-length argument list, then the old behavior still applies and floats widen to double. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry