Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: IsUnsigned() function (retiring injured) Message-ID: <6T05HF8@xds13.ferranti.com> Date: 6 Aug 90 19:57:44 GMT References: <1990Jul27.161339.14712@kfw.COM> <8118@ncar.ucar.edu> <621@.tetrauk.UUCP> <25836@mimsy.umd.edu> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 9 In article <25836@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: > Actually, the rule is fairly easy to state: `In ANSI C, when an > unsigned type is promoted% to some other type, it becomes signed > (without changing value) if and only if the new type is actually > bigger.' In practise, this means that you have to know whether > sizeof(short) < sizeof(int) and whether sizeof(char) < sizeof(int). What is the rationale for this? There's probably a good reason, but at first glance it seems counterintuitive. -- Peter da Silva. `-_-' +1 713 274 5180. 'U`