[LC++]Smallest int -2147483648 or -2147483647?

Dr Mark H Phillips mark at austrics.com.au
Wed Sep 4 16:26:05 UTC 2002


Hi,

I thought, for an intel 32 bit machine, that signed integers
ranged from -2147483648...2147483647.  That is, from
-2^31...2^31-1.  And yet, when I try to do the following:

int const minInt=-2147483648;

I get the error:

umbrella.h:43: warning: decimal integer constant is so large that it is
unsigned

Does that mean that the minimum is actually -2147483647, or does
it mean that it is first reading (2147483648) and then applying the 
minus, thus causing a problem.  If the latter, how do I form a constant
containing the minimum int?

Thanks,

Mark.


-- 
Dr Mark H Phillips
Research Analyst (Mathematician)

AUSTRICS - smarter scheduling solutions - www.austrics.com

Level 2, 50 Pirie Street, Adelaide SA 5000, Australia
Phone +61 8 8226 9850
Fax   +61 8 8231 4821
Email mark at austrics.com.au





More information about the tuxCPProgramming mailing list