|
From: <go...@fo...> - 2006-06-09 09:53:45
|
One bit is consumed by the sign (+ or -) which means that if the variable is signed it's maximum absolute value is "about" half that of a corresponding unsigned variable. An example explained the "about": Two bit integer 00 01 10 11 unsigned this would be: 0 1 2 3 signed assuming MSB contains the sign and + <-> 1 this would be: -0 -1 +0 +1 but since we only need one zero one normally does something like this: -1 0 +1 +2 that is -0 is taken to mean +2 and +0 is taken to mean 0 hence the "about". Erik Schmidt skrev: > what's the difference between a signed and unsigned variable > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |