From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <71c03031552bedd384fc0604f15ecdb7@felloff.net> Date: Mon, 14 Sep 2015 13:32:12 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=f46d04447e353e3209051fb4413b Subject: Re: [9fans] kenc vlong double Topicbox-Message-UUID: 6a765fec-ead9-11e9-9d60-3106f5b1d025 --f46d04447e353e3209051fb4413b Content-Type: text/plain; charset=UTF-8 On 13 September 2015 at 19:55, Charles Forsyth wrote: > On 13 September 2015 at 19:46, wrote: > >> so we really want to have n->type == double/float > > > no, it happens to be wrong for ordinary integers too: > > > int > x(int a, double d) > { > a += (a += d); > return a; > } > i've fixed the original problem, but the assumption that the result type is the type of the right, not the type of the left (after a store) turns out to be fairly pervasive, and i'd better fix that too. 6c and 7c get it right. the others are variously wrong. --f46d04447e353e3209051fb4413b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 13 September 2015 at 19:55, Charles Forsyth <charles.forsyth@gm= ail.com> wrote:
On 13 Septembe= r 2015 at 19:46, <cinap_lenrek@felloff.net> wrote:
so we really want to have n->type =3D=3D double/float=

no, it happens to be wrong for ordinary inte= gers too:


int
x(int a, double d)
{
a +=3D (a +=3D d);
return a;
}

i've fixed the original problem, but=C2=A0the assumption that the res= ult type is the type of the right,
not the = type of the left (after a store) turns out to be fairly pervasive, and i= 9;d better fix that too.
6c and 7c get it r= ight. the others are variously wrong.
--f46d04447e353e3209051fb4413b--