Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does RPGs inary 4 drop the high-order digit?

digit drop high high-order rpg RPGs
0
10 Posted

Why does RPGs inary 4 drop the high-order digit?

0

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

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.