However there are a few third party libraries to the rescue.
We are going to focus on qdecimal, which specifically target QT C++ at this post.
Because I use Mingw-32 QT version, the library I download does not compile properly, so instead I include the source code into my project.
#include <QCoreApplication> #include <QtConcurrent/QtConcurrent> #include "qdecimal/QDecDouble.hh" #include "qdecimal/QDecNumber.hh" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QDecDouble decDouble = 10.00; QDecDouble result = decDouble / 90; QTextStream(stdout) << result.toString(); return a.exec(); }
that's it, hop it helps.