• Base 10 number class

    From Nightfox to All on Fri Aug 14 16:56:58 2009
    Hi all -

    Does anyone know if there is a standard class or library for C++ that does base-10 math that can be compiled on any platform? One thing that bugs me about C++ is binary roundoff error, which comes into play when doing math with floating-point numbers - After enough calculations, the result isn't quite right because many base-10 values can't be represented exactly in binary form. This is important for financial calculations, which need to be very accurate.

    I know there are base-10/decimal C++ libraries that are commercial, but I'd like to find one that is free. I've come across IBM's DecNumber, which is a C library for doing base-10 calculations that is available under the GPL license, but as far as I could tell, it was designed for use with the GNU C Compiler, so it compiles easily in Linux but not in Windows (due to header file/library requirements). I'd like to be able to use it in any platform I want.

    Nightfox