Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Float Double Parameters Message-ID: <2442@utcsri.UUCP> Date: Tue, 1-Apr-86 03:17:22 EST Article-I.D.: utcsri.2442 Posted: Tue Apr 1 03:17:22 1986 Date-Received: Tue, 1-Apr-86 03:42:36 EST References: <2600042@ccvaxa> <5216@alice.uUCp> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 30 Summary: In article <5216@alice.uUCp> ark@alice.UucP (Andrew Koenig) writes: >>X3J11 says "arguments that have type float are promoted to double". Too bad. > >Ansi C also lets you declare types of formal parameters to externals: > > extern float f(float x); >in which case: > f(1); /* 1 is converted to float */ > f(1.0); /* 1.0 is converted to float */ > >are both OK. OK, but doesn't "extern float f(float x)" really mean "extern float f( double x )"? I.e. '1' and '1.0' are passed as doubles to f in the above examples. I don't know, but I suppose this feature has been added only to allow the compiler to check ( and convert when applicable ) the parameter types. If the above *is* correct, then apparently I can pass a float to a function ( provided it is not defined in the current file (!?!?!?!) ) but it is *not* possible to write a function that accepts a float as a parameter. C is strange, but not that strange - I suspect Mr. Koenig has read something into the standard that is not there. If anyone has reliable information to the contrary, let us know... -- "If you aren't making any mistakes, you aren't doing anything". ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg