Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 12 May 2011 20:18:39 -0500 Date: Thu, 12 May 2011 18:18:29 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Java puzzler References: <4db69c13-878f-4806-adb2-a3c5adb1c48c@glegroupsg2000goo.googlegroups.com> <-8mdnSRPEIdA21HQnZ2dnUVZ_j2dnZ2d@earthlink.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 20 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.8.126.96 X-Trace: sv3-HEMSNvA68nNYz1i6Pt8EnhK6m61epDGj5wJ2CKKh6JojQbAyvK1Ta7zM5DgKCOkVoa5uWuI8EYyc1yK!W4Lml2I+3W3iFHKuZt3y9+if7xToi7BQ2zL3eViNus3cCee5Cw5nARa5nQsPViSfViuP8Rv6OB9T!qCG/cHzGpQznR84IZPbkO2qlEo0RegqDaEPfBZAee6M= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2318 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4032 On 5/12/2011 5:40 PM, markspace wrote: > On 5/12/2011 4:05 PM, Patricia Shanahan wrote: > >> If (byte)100 + (byte)100 caused an overflow, I would need an unsigned >> byte type to do the same job. > > OK, I think I understand. If the goal is to allow unsigned arithmetic > with automatic overflow detection, they we'd have to add unsigned > integer primitives to the language. The original proposal was to make all arithmetic detect overflow, and that would remove the existing ability to do unsigned arithmetic by ignoring overflow. If overflow detection is to be applied conditionally, it would keep all the complexities of undetected overflow, and add rules for deciding when to do overflow detection. Patricia