Is there a C++ equivalent to Java's BigDecimal? -
i'm looking c++ class can decimal floating point arithmetic. looking through http://speleotrove.com/decimal/ there links sorts of classes people have written , not maintained. digging through decnumber++ stuff led me emails showing gcc support functionality. (formally known iso/iec tr 24733)
i'm looking can use drop-in replacement float or double, other people using in own projects. open source.
thanks!
edit: should point out i'm trying use represent prices. need exact decimals, not huge decimals.
there exists huge library called gmp (gnu multiple precision library) supports , has c++ bindings, though honest c++ interface bit wonky , outdated.
an example documentation, following creates float called f
@ least 500 bits of precision:
mpf_class f(1.5, 500);
Comments
Post a Comment