Modern C++ implementation of binary-coded decimal (BCD) routines
This header-only library provides a native binary-coded decimal type. Wikipedia It provides an integer type library that stores its values in BCD format instead of pure binary.
See the test program for many examples of how to use it.
BCD is not widely used anymore due to the vast speed improvements of division routines over the last 50 years. The primary benefit of BCD was that it was cheap to print/display, but on modern CPUs with
- processors running thousands of times faster,
- builtin division support, and
- a preference for cache efficiency to achieve performance
the BCD type is no longer as critical. However it remains a favorite of mine due to the initialism :)
- BCD