Article View: comp.std.c
Article #3982Re: Type of expression
From: Mark Brader
Date: Wed, 13 Sep 1995 01:47
Date: Wed, 13 Sep 1995 01:47
24 lines
1550 bytes
1550 bytes
> > It may be worth noting that all integer constants represent positive values [He means non-negative, of course.] > > (perhaps there are theoretical circumstances where a character constant > > could end up negative). ... > Could you quote a reference for this please? (Genuine request for > enlightenment - not an attempt to dispute it.) I've looked at the > standard, and clearly the syntax of decimal integer constants excludes > the possibility of them being negative, but I can't find anywhere where > it says that hex constants must be interpreted as positive. But exactly the same reasoning applies in both cases! A hexadecimal constant is just a whole number written in base 16, with 0x or 0X tacked on the front -- exactly as a decimal constant is a whole number written in base 10. Nothing is said in 6.1.3.2/3.1.3.2 about any sort of negation. -- Mark Brader | "I love talking about nothing. msb@sq.com | It's the only thing I know anything about." SoftQuad Inc., Toronto | -- Lord Goring (Oscar Wilde: An Ideal Husband) My text in this article is in the public domain.
Technical Details
Message-ID:
<1995Sep13.014750.28868@sq.com>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!torn!sq!msbReferences:
<42df0h$73v@elf.bsdi.com> <DEHyMv.E4r@stdc.demon.co.uk> <810609935snz@genesis.demon.co.uk> <DEstEs.7wJ@polo.demon.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!howland.reston.ans.net!torn!sq!msb From: msb@sq.com (Mark Brader) Subject: Re: Type of expression Message-ID: <1995Sep13.014750.28868@sq.com> Organization: SoftQuad Inc., Toronto, Canada References: <42df0h$73v@elf.bsdi.com> <DEHyMv.E4r@stdc.demon.co.uk> <810609935snz@genesis.demon.co.uk> <DEstEs.7wJ@polo.demon.co.uk> Date: Wed, 13 Sep 1995 01:47:50 GMT