Newsgroups: comp.lang.c Path: utzoo!censor!geac!nixtdc!rmc From: rmc@nixtdc.uucp (Russell Crook) Subject: Re: % operator with negatives Message-ID: <1990Dec13.142701.7587@nixtdc.uucp> Reply-To: rmc@nixtdc.UUCP (Russell Crook) Organization: Siemens Nixdorf Information Systems References: <1990Dec12.185714.7169@mp.cs.niu.edu> <1990Dec12.205416.26622@zoo.toronto.edu> <7461:Dec1310:04:0990@kramden.acf.nyu.edu> Distribution: na Date: Thu, 13 Dec 90 14:27:01 GMT Even more disturbing about the / ambiguity... If I interpret the ANSI standard correctly, there is no guarantee that (-a)/b == a/(-b) where a and b are positive (e.g., 14 and 10). It appears to be legal for the rounding direction to vary arbitrarily even on one machine when / and negative numbers are involved. Yecch. It would have been nice to have / more tightly defined, but (alas) reality intrudes. We have to work with several systems, and the preferred rounding direction does indeed vary between them. And yes, we got bitten by it :-< :-< . -- ------------------------------------------------------------------------------ Russell Crook, Siemens Nixdorf Information Systems, Toronto Development Centre 2235 Sheppard Ave. E., Willowdale, Ontario, Canada M2J 5B5 Ph: +1 416 496 8510 Fax: +1 416 496 8534