English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In signed int the msb bit is is 0 or 1.which specifies the no is +ve or -ve n range is -32676 to+32678. n when we use unsigned int the range get doubles although we only free one bit

2006-08-10 22:35:01 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

The range doesnt really double, it is just all on the positive side. With (signed)int the range is from -32768 to +32767, the difference is 65535 (32768 + 32767). With unsigned int the range is 0 to 65535.

2006-08-11 01:58:34 · answer #1 · answered by justme 7 · 0 0

by not using a signed bit then we can use the MSB to store a larger number number. If we look at a very simple example using 2 bits we can store from 0 to 3 if we made that use a signed bi then we could only store -1, 0 and 1. So not only can we only represent less numbers bbut we also dont get such a high maximum number. So we are not really doubling the range we are only doubling the positive range.

2006-08-10 22:41:48 · answer #2 · answered by barhud 3 · 0 0

16-bit is called short int, not int. When you use only 15 bits of 16, you max.absolute value is 2^15. For unsigned, you use also upper bit of the 16-bit word, so you have 2^16.
The same thing for integers: 2^31 for signed, 2^32 for unsigned.

2006-08-10 22:43:47 · answer #3 · answered by alakit013 5 · 0 0

whoooooo! what the heck are you talking about?

2006-08-10 22:39:39 · answer #4 · answered by D B 1 · 0 0

fedest.com, questions and answers