answersLogoWhite

0

Why character's range -128 to 127?

User Avatar

Anonymous

14y ago
Updated: 7/26/2023

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.

User Avatar

Jay O'Connell

Lvl 9
1y ago

What else can I help you with?

Related Questions

What is range of A 8 bit signed integer?

-128 to 127


Why have character range -128 to 127?

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


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.


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


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 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.


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


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).