Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!uupsi!sunic!dkuug!freja.diku.dk!skinfaxe.diku.dk!jensting From: jensting@skinfaxe.diku.dk (Jens Tingleff) Newsgroups: comp.lang.c Subject: Re: () ignored in some expressions Message-ID: <1990Apr10.061333.29693@diku.dk> Date: 10 Apr 90 06:13:33 GMT References: <48079@lanl.gov> <16414@haddock.ima.isc.com> Sender: news@diku.dk (The Netnews System) Organization: Department Of Computer Science, University Of Copenhagen Lines: 26 karl@haddock.ima.isc.com (Karl Heuer) writes: >In article <48079@lanl.gov> u096000@lanl.gov (Roger A. Cole) writes: [..] >Optimization. With unsigned integers (and also signed integers in the usual >implementation), you get exactly the same answer anyway, so why not explicitly >allow it? Ahemm. Am I stupid, or is the result of 1000*(1000 - 999) quite dependant on the parenthesis being done properly (assume 16 bit int's..)? Granted that unsigned int math shouldn't give an overflow exception, you might get it right there. But with signed int, giving overflow exceptions, you'd be in real trouble. Change the above to 1000*(999 - 1000) if you like.. . Of course, with floating point, the problems might be worse, e.g. optimisation changing the result of a valid and reasonable program.. . Jens jensting@diku.dk is Jens Tingleff MSc EE, Research Assistent at DIKU Institute of Computer Science, Copenhagen University Snail mail: DIKU Universitetsparken 1 DK2100 KBH O