Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 ggr 10/10/85; site bentley.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!bentley!kwh From: kwh@bentley.UUCP (KW Heuer) Newsgroups: net.lang.c Subject: Re: unary + Message-ID: <630@bentley.UUCP> Date: Wed, 12-Mar-86 10:18:28 EST Article-I.D.: bentley.630 Posted: Wed Mar 12 10:18:28 1986 Date-Received: Fri, 14-Mar-86 06:18:39 EST References: <1227@mtx5a.UUCP> <1223@mit-eddie.MIT.EDU>, <1147@lsuc.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner Lines: 13 In article <1147@lsuc.UUCP> lsuc!msb (Mark Brader) writes: ... > #define ROUND(real) ((long) .5 + (real)) ... >There are, of course, NO unnecessary parentheses in the example. True, they are necessary, but they are not sufficient. If you want ROUND to do what its name implies (for nonnegative arguments), you should have written it #define ROUND(real) ((long)(.5 + (real))) since unary operators (including cast) have precedence over addition. Just thought I should point that out, since you were otherwise being quite careful with parens.