Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site nsc.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!menlo70!nsc!myunive From: myunive@nsc.UUCP (Jay Zelitzky) Newsgroups: net.bugs.4bsd,net.bugs.usg Subject: Re: integer op= floating evaluated incorrectly by C compiler Message-ID: <541@nsc.UUCP> Date: Fri, 13-Jan-84 21:01:35 EST Article-I.D.: nsc.541 Posted: Fri Jan 13 21:01:35 1984 Date-Received: Sun, 15-Jan-84 06:15:45 EST References: <1625@randvax.ARPA> Organization: National Semiconductor, Sunnyvale Lines: 11 .......... Everyone has been missing another case where there is a problem: int /= unsigned; will do an integer divide instead of the correct unsigned divide. This will result in a different value in some cases. For example: (2^32-1)/2 will equal some large number if the division is done unsigned and 0 if the division is signed. A slight variation of the previously posted fix will also fix this case. Jay Zelitzky {menlo70,fortune}!nsc!myunive