Is there a C++ equivalent to Java's BigDecimal?+1: Actually this answer makes more sense to me than most others, which suggest GMP or MAPM. Those arbitrary precision libraries use base 2, which means a value such as 0.1 can never be represented exactly, whatever precision you may set. Storing everything as cents, in other words multiplying everything by 100 and using int64_t seems like a perfectly acceptable solution to me. At least all additions will be exact.

Negative NaN is not a NaN?The accepted answer does not detail anything and does not provide a workaround for the problem. And please, downvoted because I gave the same answer to the same question? Welcome to my personal list of negatively combative people I have no longer any intention of interacting with until they grow up somewhat.