answersLogoWhite

0


Best Answer

We need signed integers in order to represent both negative and positive values. However, some numbers can never be negative. For instance, the size of a file must always be greater than or equal to zero so we use unsigned integers to represent file sizes. Also, natural numbers must be greater than 0 so there's no point in using a signed value to represent a natural number. Signed integers also use one bit to denote the sign, but unsigned integers do not thus unsigned integers can effectively represent twice the range of positive values than an unsigned integer can. For instance, an 8-bit signed value can represent values in the range -128 to +127 using twos complement notation, but an 8-bit signed value can represent values in the range 0 to 255.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do you need signed and unsigned integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between signed integer and unsigned integer?

An unsigned integer cannot be negative. It has a maximum positive value twice that of a signed integer. Max signed: 128 Max signed: 256 I could be off by one there, though.


What is the difference between signed integer and unsigned integer in terms of memory and range?

Signed integer is any integer that carries negative sign while unsigned integer is any integer that carries positive sign


Difference between signed and unsigned int?

A signed integer is one with either a plus or minus sign in front. That is it can be either positive or negative.An unsigned integer is assumed to be positive


Difference between signed number from unsigned number?

a signed number is one that can be negative (have a sign) whereas an unsigned number will only be positive. due to less information, you can double the largest number storable in a signed integer to get the data available in an unsigned integer. However, PHP doesn't have unsigned integers, they're all signed.


What is the significance of declaring a constant unsigned integer?

What is the significance of declaring a constant unsigned integer?


What are the permissible data types for an array index?

Integer (signed or unsigned)


Is unsigned integer available in java?

No..Java Supports Signed positive and negative integers


Why do we have 2 DATA types of same size for integer?

One of them is signed, the other is unsigned.


Meaning of signed integer in c language?

signed integer means that it has a sigh (+ or -). Using another words you say that signed variable can be positive as well as negative. unsigned variables can be only positive.


What is an unsigned integer?

Having an unsigned integer means that the integer is positive, and not negative; literally, the integer is unsigned and assumed to be positive. The unsigned integer 8 is positive-eight, not negative-eight.


What is the highest decimal number that can be represent by 8 binary bits?

The highest unsigned integer is 255; The highest signed integer is 127.


What is the maximum value that can be stored in an integer in c?

if it is a signed int the the range is -32768 to 32767if its unsigned then 0 to 65535