Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!apple!motcsd!motsj1!mcdchg!att!cbnewsd!knudsen From: knudsen@cbnewsd.ATT.COM (michael.j.knudsen) Newsgroups: comp.lang.c Subject: Re: is this broken or what? Summary: Unsigneds never WHAT? Message-ID: <12980@cbnewsd.ATT.COM> Date: 31 Jan 90 18:21:53 GMT References: <28941@amdcad.AMD.COM> <578@idacrd.UUCP> <1093@sdrc.UUCP> Organization: AT&T Bell Laboratories Lines: 15 In article <1093@sdrc.UUCP>, scjones@sdrc.UUCP (Larry Jones) writes: > i-- also overflows), but not if i is unsigned (since unsigned > arithmetic never overflows). Excuse me -- one of us needs either a more reliable drugs supplier, or a newer dictionary. Unsigned arithmetic certainly can overflow-- it just gives you twice the headroom before it happens. Doing i-- where i==0 will give a big surprise. So will adding two positive numbers big enuf to wrap around. Is this behavior not labeled "overflow"? Correct me if I'm wrong about this. -- Mike Knudsen knudsen@ihlpl.att.com (708)-713-5134 "Round and round the while() loop goes; Whether it stops," Turing says, "no one knows."