pub fn get_binary_width_from_digits(digits: u16) -> u16Expand description
Map a COBOL PIC digit count to the corresponding USAGE BINARY storage width in bits (NORMATIVE).
Follows the COBOL standard mapping:
- 1-4 digits -> 16 bits (2 bytes, halfword)
- 5-9 digits -> 32 bits (4 bytes, fullword)
- 10-18 digits -> 64 bits (8 bytes, doubleword)
§Arguments
digits- Number of digit positions declared in the PIC clause
§Returns
The storage width in bits: 16, 32, or 64.
§See Also
validate_explicit_binary_width- For explicitUSAGE BINARY(n)declarationsdecode_binary_int- Decodes binary integer data at the determined width