From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <817c1134cd276abf444e8f03633b63d4@mikro.quanstro.net> References: <015a7a246411aad9175339f972052f20@quintile.net> <817c1134cd276abf444e8f03633b63d4@mikro.quanstro.net> Date: Thu, 27 Feb 2014 12:29:18 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7bb70ae4558ba404f3627870 Subject: Re: [9fans] IEEE floats Topicbox-Message-UUID: be86d644-ead8-11e9-9d60-3106f5b1d025 --047d7bb70ae4558ba404f3627870 Content-Type: text/plain; charset=UTF-8 On 27 February 2014 12:09, erik quanstrom wrote: > did they abolish the rule that float is promoted to double > on function call? or is this the equivalent of char fu(char) vs > int fu(int). > if you use the original declaration syntax of 40 years ago, float must be promoted to double because the caller won't know the type, but the ANSI declarator syntax that everyone ought to be using allows the distinction between float and double to be maintained, and it is. compare void g(float a) { g(a); /* a is float */ } void h(a) float a; { h(a); /* a is double */ } --047d7bb70ae4558ba404f3627870 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 27 February 2014 12:09, erik quanstrom <quanstro@quanstro.net&g= t; wrote:
did = they abolish the rule that float is promoted to double
on function call? =C2=A0or is this the equivalent of char fu(char) vs
int fu(int).

if you use the original declaratio= n syntax of 40 years ago,
float must be pro= moted to double because the caller won't know the type,
but the ANSI declarator syntax that everyone ought to be using allows
=
the distinction between float and double to be m= aintained, and it is.
compare

void
<= div class=3D"gmail_extra">g(float a)
{
g(a); =C2=A0 =C2=A0/* a is float */
}

void
h(a)
float a;
{
h(a); =C2=A0 =C2=A0/* a = is double */
}

--047d7bb70ae4558ba404f3627870--