Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: Date: 2 Apr 91 20:57:08 GMT References: <15053@ganymede.inmos.co.uk> <3482@inews.intel.com> <20137@alice.att.com> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 13 ark@europa.att.com (Andrew Koenig) writes: >It turned out that the effects differed if the subtract >caused an overflow (call it underflow if you like) with a >zero result. In the first case, the test would show that >a==0. In the second, the condition code would show an >overflow. Overflow is not the same as zero, so the test >would fail. Was this a 1s-complement machine? A sane 2s-complement machine can't produce 0 on subtraction unless the numbers are equal. , Eamonn