From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <015a7a246411aad9175339f972052f20@quintile.net> From: "Steve Simon" Date: Thu, 27 Feb 2014 11:51:20 +0000 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] IEEE floats Topicbox-Message-UUID: be674c48-ead8-11e9-9d60-3106f5b1d025 Porting stuff from the net (under ape) which wants to use IEEE floats. i.e. ieee754_float32_t, powf(), fabsf() and log10f(). I could map these to plan9 floats and call the double version of the transient functions, but is there a better solution? -Steve From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 27 Feb 2014 07:09:24 -0500 To: 9fans@9fans.net Message-ID: <817c1134cd276abf444e8f03633b63d4@mikro.quanstro.net> In-Reply-To: <015a7a246411aad9175339f972052f20@quintile.net> References: <015a7a246411aad9175339f972052f20@quintile.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] IEEE floats Topicbox-Message-UUID: be7149fa-ead8-11e9-9d60-3106f5b1d025 On Thu Feb 27 06:54:22 EST 2014, steve@quintile.net wrote: > Porting stuff from the net (under ape) which wants to use IEEE floats. > i.e. ieee754_float32_t, powf(), fabsf() and log10f(). >=20 > I could map these to plan9 floats and call the double version > of the transient functions, but is there a better solution? plan 9 uses ieee floating point on machines that support it (all current arches) so ieee754_float32_t =E2=89=A1 float. substituting the double version should work. 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). - erik 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 27 Feb 2014 07:45:47 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: References: <015a7a246411aad9175339f972052f20@quintile.net> <817c1134cd276abf444e8f03633b63d4@mikro.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] IEEE floats Topicbox-Message-UUID: be8d279c-ead8-11e9-9d60-3106f5b1d025 > 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 */ > } thanks! - erik