Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wgate!lanzo From: lanzo@wgate.UUCP (Mark Lanzo) Newsgroups: comp.lang.c Subject: Re: IsUnsigned function? [A solution which almost works!] Message-ID: <106@atesysv.UUCP> Date: 26 Jul 90 13:17:38 GMT References: <15303b1aa0bf26a8c5d4@canremote.uucp> Reply-To: lanzo@atesysv.UUCP (Mark Lanzo) Organization: Wandel & Goltermann Technologies, RTP, NC Lines: 15 My boss thought this one up: #define IsUnsigned(x) (!( (x) < 0 || (-(x) < 0) )) This will work, as long as "x" is a nonzero value. At least this one tries to answer the actual question "Is it unsigned?" and not "is it negative?" or "is the m.s.b. set?" ... -- Mark Lanzo Wandel & Goltermann Technologies, Inc. Home (919)481-2406 1030 Swabia Court Play (919)941-5730 Research Triangle Park uunet.uu.net!wgate.com!lanzo North Carolina 27709-3585