Fixed Point Decimal Class for C++
Sunday, June 17th, 2007I recently needed a fixed point decimal support in C++ for an inventory program I’m writing. Why doesn’t one already exist? I don’t know. There’s one for boost, but since I’m already using Qt, I don’t really see a need to pull in yet another (big) dependency.
It’s public domain, and appears to work (for me, anyway). It’s all standard C++ with no extra dependencies, and should work on all operating systems (although I’ve only tested it on Linux/g++-3.4). Please shoot me a mail (tajmorton@gmail.com) or leave a comment if you find a problem. See this page for it if you’re interested (hello Google bot):