From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <71c03031552bedd384fc0604f15ecdb7@felloff.net> References: <71c03031552bedd384fc0604f15ecdb7@felloff.net> Date: Sun, 13 Sep 2015 19:55:21 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a1130cbaea8c360051fa57d80 Subject: Re: [9fans] kenc vlong double Topicbox-Message-UUID: 6a707d20-ead9-11e9-9d60-3106f5b1d025 --001a1130cbaea8c360051fa57d80 Content-Type: text/plain; charset=UTF-8 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; } should have the outer += done as int using the result of a += d as stored back into `a' and read back, but instead it incorrectly does two floating-point adds. it evidently isn't that common to feed the result of += etc back into a computation, at least with mixed modes, or this would have been more troublesome. --001a1130cbaea8c360051fa57d80 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 13 September 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 ordi= nary integers too:


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

should have the outer +=3D don= e as int using the result of a +=3D d as stored back into `a' and read = back,
but instead it incorrectly does two floating-point adds. it= evidently isn't that common to feed the result
of +=3D etc b= ack into a computation, at least with mixed modes, or this would have been = more troublesome.
--001a1130cbaea8c360051fa57d80--