answersLogoWhite

0


Best Answer

To let the very first bit (2^7) show the sign of the number: bit=1 means negative (-128..-1), bit=0 means non-negative (0..127)

00H=0

...

7fH=127

80H=-128

...

ffH=-1

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

The range of -128 to +127 is the range of a signed integer of length 8-bits when considered as a two's complement number. Normally, you do not consider characters to be integers, and you do not normally do arithmetic on them. Also, they can be unsigned, meaning they have a range of 0 to 255.

It is not considered portable, nor appropriate, to treat characters as integers in terms of their arithmetic values or vice versa.

Platform-dependent; on some platform the default char-type is signed char (-128..127), on others it is unsigned char (0..255).

Note: getchar returns a -1..255 value (where -1 represents EOF); if you assign it to a char (before checking for EOF), you will lose information.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why have character range -128 to 127?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the range of integer char float for a 16-bit computer?

Consult your limits.h and math.h. For char it will be -128..127 or 0.255 (signed and unsigned).


How do you convert a char to an integer in Visual Basic 2010?

A char is already an integer, so there is no conversion required. A character is simply an integer that maps to a glyph in the current code page. ASCII characters are 1 byte long and have a value in the range 0 to 127 while extended ASCII characters are in the 128 to 255 range. Wide characters (UTF16 UNICODE) characters are two bytes long and cover the range 0 to 65,535, where 0 to 127 map to the standard ASCII character set. UTF8 UNICODE characters are variable width (1 to 6 bytes in length), where 0 to 127 are single-byte characters mapping to the standard ASCII set.


How are char -type constants and char-type variables interpreted when used as operands with a relational operator?

As integers, within range -128..127 if signed, 0..255 if unsigned.


What is the ASCII value of -1?

acii value of 1 is 49 for a complete list check out: http://www.killersites.com/webDesignersHandbook/ascii_page2.htm


What is the numerical range of a char?

There is no defined range of values in C. The built-in types all have ranges that are defined in <stdint.h>, <limits.h> and <float.h>. These ranges are implementation-defined, they are not defined by the language or by the standard. The standard only defines minimum guarantees such that a char is always at least 8 bits long (CHAR_BIT) and that an int is at least as long as a short which is at least as long as a char.

Related questions

What is range of A 8 bit signed integer?

-128 to 127


What is range of A 8-bit signed integer?

-128 to 127, in two's-complement.


What is range of 8-bit signed integer?

-128 to 127, in two's-complement.


What is the biggest number that 1byte can hold?

The range for signed numbers is -128 to +127. The range for signed numbers is 0 to 255.


How many strings of five ASCII characters contain the character at least once?

the total 128 ^5 the strings without @ at all 127^5 to get the strings that has at least @ once 128^5 - 127^5


Why character's range -128 to 127?

The range of -128 to +127 is the range of a signed integer of length 8-bits when considered as a two's complement number. Normally, you do not consider characters to be integers, and you do not normally do arithmetic on them. Also, they can be unsigned, meaning they have a range of 0 to 255.It is not considered portable, nor appropriate, to treat characters as integers in terms of their arithmetic values or vice versa.Platform-dependent; on some platform the default char-type is signed char (-128..127), on others it is unsigned char (0..255).Note: getchar returns a -1..255 value (where -1 represents EOF); if you assign it to a char (before checking for EOF), you will lose information.


Describe the range of numbers that can be represented by a 8 bit number using two complement?

-128 to 127


Range of signed numbers that can be stored in an 8 bit register?

Range of 8 bit signed number is -128 to 127 Reference: digital fundamentals by Floyd


Why do variable of character datatype accepts integer value and how it shows the value when you use percent percent d to print it in C?

1. It is by design; the value range is either -128..127 or 0..255 2. You will see a number.


What is 1 plus 127?

128


What is the range of integer char float for a 16 bit computer?

Consult your limits.h and math.h. For char it will be -128..127 or 0.255 (signed and unsigned).


What is the range of integer char float for a 16-bit computer?

Consult your limits.h and math.h. For char it will be -128..127 or 0.255 (signed and unsigned).