Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

What does this exactly mean? The size of a data type dictates the range of values that can be assigned to a variable of that type.

OpenStudy (anonymous):

A quick and easy example to understand that is the following: The data type byte for example is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive) Therefore the size of the byte data type dictates what values it can hold.

OpenStudy (rsmith6559):

If you could only use one digit for a number, you could have 10 values, 0 - 9. If you could use two digits, you could have 100 values, 0 - 99. Same principle with bytes. A byte is 8 binary digits. A binary digit can have a value of either 0 or 1, hence the binary. With 8 bits (BInary DigiTs), you could have 256 values, 0 - 255. Two bytes, or 16 bits, 65,536 ( 256 * 256 ) possible values, 0 - 65535. Four bytes, 32 bit, a bit over 4 billion possible values. Eight bytes, 64 bit is something like 15 quadrillion possible values.

OpenStudy (anonymous):

@Chris2332 Thanks but next time would you mind explaining why -127 to 127 ... I am lucky for I study those things and understand that is it under the binary numeric system.

OpenStudy (anonymous):

This is because as we said the byte data type is 8-bit signed integer. This means tha you have 7 byte positions to describe your number in binary form and one (the left most) to describe the sign of your number. 127 will give you the binary 1111111 (that's 7 ones) and the first byte will be 0 (for positive) while -128 will be 0000000(that's 7 zeros) and the first byte will be 1 (for negative). Does that make sense now?

OpenStudy (anonymous):

I know it but thanks for answering by the way.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Mari103: How to pop out like a Jacc In the box
46 minutes ago 0 Replies 0 Medals
Breathless: Spooky witch but cute
7 hours ago 3 Replies 0 Medals
Arriyanalol: help
7 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
10 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
10 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!