How does the Number Class compare with Binary Coded Decimal (BCD)?
The problem of dealing with numbers that don’t fit into 64 bits is not a new one. For decades programmers of IBM mainframe computers have used variations of Binary Coded Decimal or “packed decimal” numeric encodings to cope with long numbers, supported not only by most mainframe programming languages, but right down to the hardware. The C/C++ programming language and most modern microprocessors, however, do not support packed decimal arithmetic. Packed decimal numbers are reasonably compact because they store 2 decimal digits in each 8-bit byte, i.e. 1 digit per 4-bit “nibble”, using either a fixed-length or a variable-length encoding. There is no explicit decimal point, and the rightmost nibble is used to store a sign. For fixed-length numbers, the scale (i.e. the placement of the decimal point) is determined by a declaration statement in the program. Variable-length packed decimal stores the total length and scale in the first byte of the number. The Base/1 Number Class is similar to