BCD subtraction wants improvement
This SO Q&A provides some guru-level bit fiddles to sum two “packed” BCD values.
Extending those to use uint64_t
variables, two 16 digit (decimal) values can be summed and easily output.
(That’s up to $99,999,999,999,999.99 for fixed-point currency calcs.)
With its carry-in and carry-out, stacking several BCD ‘buffers’ means the sky’s the limit for values used.