is this broken or what?

michael.j.knudsen knudsen at cbnewsd.ATT.COM
Thu Feb 1 05:21:53 AEST 1990


In article <1093 at sdrc.UUCP>, scjones at 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 at ihlpl.att.com   (708)-713-5134
"Round and round the while() loop goes;
        Whether it stops," Turing says, "no one knows."



More information about the Comp.lang.c mailing list