Binary-coded decimal: Difference between revisions

Content deleted Content added
m Packed BCD: formatting fix
Line 403:
|}
 
No matter how many bytes wide a [[Word (datacomputer typearchitecture)|word]] is, there is always an even number of nibbles because each byte has two of them. Therefore, a word of ''n'' bytes can contain up to (2''n'')−1 decimal digits, which is always an odd number of digits. A decimal number with ''d'' digits requires {{sfrac|1|2}}(''d''+1) bytes of storage space.
 
For example, a 4-byte (32-bit) word can hold seven decimal digits plus a sign and can represent values ranging from ±9,999,999. Thus the number −1,234,567 is 7 digits wide and is encoded as: