Why does RPGs inary 4 drop the high-order digit?
Well, RPG’s ‘binary’ data type does not support the full range of numbers possible in a binary number. Maybe I need to back up. A binary number (in the sense the manual uses the word binary) is one whereby each binary digit is used to represent a numeric value in increasing powers of two. So, a 2 digit binary number can hold numeric values as high(!) as 4: 2 (binary) to the 2nd (two digits) power = 4. An 8 digit binary number can hold numeric values as high as 2^8, or 256. A two byte binary number has 16 bits (digits) so it can hold numeric values as high as 2^16, or 65536. (I’m ignoring the sign for this discussion.) An RPG ‘binary’ data type can be two bytes or four. Sneaking a peek at the RPG Reference, Chapter 10 (Data types) we can see that the 2 byte ‘binary’ gets defined with a length of 4. Theoretically a two byte field should be able to hold a value up to 65536 as described above. But with length 4, we can only store up to 9999! That high-order digit simply can’t be stored in
Well, RPG’s ‘binary’ data type does not support the full range of numbers possible in a binary number. Maybe I need to back up. A binary number (in the sense the manual uses the word binary) is one whereby each binary digit is used to represent a numeric value in increasing powers of two. So, a 2 digit binary number can hold numeric values as high(!) as 4:2 (binary) to the 2nd (two digits) power = 4.An 8 digit binary number can hold numeric values as high as 2^8, or 256. A two byte binary number has 16 bits (digits) so it can hold numeric values as high as 2^16, or 65536. (I’m ignoring the sign for this discussion.)An RPG ‘binary’ data type can be two bytes or four. Sneaking a peek at the RPG Reference, Chapter 10 (Data types) we can see that the 2 byte ‘binary’ gets defined with a length of 4. Theoretically a two byte field should be able to hold a value up to 65536 as described above. But with length 4, we can only store up to 9999! That high-order digit simply can’t be stored in a 4