Usage is for price representation on the Ritchie Stock Exchange. How should I store prices in the order book, market data, logs... prices are everywhere.Your problem is the above. "Getting it right the first time" depends on what usage you need. If you need to sort numbers, maybe int64 will be OK for you, given some limitations. Or maybe int64 + last int64 for exponent part (forgoing unlimited precision and numerical range)?
What limitations can you live with? If you want to be completely unbounded, these problems will keep popping up at every turn, which is why serious software vendors design with sane limitations in the first place.
By using C++ and some STL/Boost libraries, maybe you can template away from the problem, but do you really really need to?
The huge difference here is that businesses focus on the businessproblems, while you take on this not as a business, but for exploration and research, with a technical focus.
For U.S. equities, the price must be accurate to the penny; for forex, to the pip (0.0001). Zero tolerance for error in price!

