IsUnsigned() function?

Kent Williams williams at umaxc.weeg.uiowa.edu
Mon Jul 23 06:31:48 AEST 1990


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 at umaxc.weeg.uiowa.edu    turtles", but I can't understand "mutually 
williams at herky.cs.uiowa.edu      recursive inline functions".' - Paul Chisholm

--
Kent Williams                    'Look, I can understand "teenage mutant ninja 
williams at umaxc.weeg.uiowa.edu    turtles", but I can't understand "mutually 
williams at herky.cs.uiowa.edu      recursive inline functions".' - Paul Chisholm



More information about the Comp.lang.c mailing list