Find a battle-tested library for the problem you're solving right now.

Decimal

An implementation of IEEE754 Decimal Floating Point Numbers.

C++ 14