Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!ns-mx!umaxc.weeg.uiowa.edu!williams From: williams@umaxc.weeg.uiowa.edu (Kent Williams) Newsgroups: comp.lang.c Subject: Re: IsUnsigned() function? Message-ID: <1932@ns-mx.uiowa.edu> Date: 22 Jul 90 20:31:48 GMT References: <1990Jul16.214155.5087@Neon.Stanford.EDU> <3539@sactoh0.UUCP> <17125@haddock.ima.isc.com> <1990Jul20.144241.2560@diku.dk> <3566@sactoh0.UUCP> Sender: news@ns-mx.uiowa.edu Reply-To: williams@umaxc.weeg.uiowa.edu.UUCP (Kent Williams) Organization: U of Iowa, Iowa City, IA Lines: 27 What I want to know, is what do they mean by IsUnsigned? a. Was the number declared to be unsigned? -- No way to test this -- if it was unsigned, then the sign bit (in most implementation) is just another bit of significance. b. Is the number negative? That is the question everyone seems to be answering, which suggests something trivial like int IsUnsigned(int x) { return x >= 0; } for which most compilers will generate only two or three instructions. c. Something else -- who knows? I noticed a few people couldn't let the chance to do some MicroSoft bashing. C'mon -- worry about something important! They certainly have no monopoly on stupid interview questions. Kent Williams 'Look, I can understand "teenage mutant ninja williams@umaxc.weeg.uiowa.edu turtles", but I can't understand "mutually williams@herky.cs.uiowa.edu recursive inline functions".' - Paul Chisholm -- Kent Williams 'Look, I can understand "teenage mutant ninja williams@umaxc.weeg.uiowa.edu turtles", but I can't understand "mutually williams@herky.cs.uiowa.edu recursive inline functions".' - Paul Chisholm