From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <52607cb8b4723e1490f67b6451fc4ef5@felloff.net> Date: Sun, 13 Sep 2015 19:31:29 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=f46d04447e3549679b051fa528d7 Subject: Re: [9fans] kenc vlong double Topicbox-Message-UUID: 6a57a5fc-ead9-11e9-9d60-3106f5b1d025 --f46d04447e3549679b051fa528d7 Content-Type: text/plain; charset=UTF-8 On 13 September 2015 at 19:21, erik quanstrom wrote: > isn't the && !mixedasop() added to the condition the problem: > the cast should not be elided if it's a float/double. t > the test is correct, because in mixed-mode assignment, you want to do the calculation in float/double, then convert it to the integer type, not convert the rhs float/double to the integer type at the start. ie, I += D is I = I+D which is I = (double)I + D, not I += (int)D; --f46d04447e3549679b051fa528d7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable