| Author |
Overflow of byte
|
Robert Ziel
Greenhorn
Joined: Apr 22, 2002
Posts: 28
|
|
hi, can someone explain to me when a byte flows over it turns negative .. ??? thanks, Robert
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
Robert, A byte is an 8 bit integer data type. The possible range of the value of a byte is -128 to 127. Let's consider adding one to the bit representation of the maximum value of 127: Now, mosey on over to The JavaRanch Campfire and learn all about Cat and Mouse Games with Bits! Good Luck.
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
|
|
Dirk, it looks like your binary addition could use a little help. Just wanted to clear that up. Corey
|
SCJP Tipline, etc.
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
Hey, it was early in the morning. You should have seen the first draft - it was worse. Thanks Corey.
|
 |
Robert Ziel
Greenhorn
Joined: Apr 22, 2002
Posts: 28
|
|
Thanks guys, this clears it up... Robert
|
 |
 |
|
|
subject: Overflow of byte
|
|
|