Decimal arithmetics in C or C++?

The IEEE-754 norm define decimal arithmetics in order to avoid rounding errors when using base-ten floating point numbers (see for example decimal64 on wikipedia). Is there a way to use this decimal arithmetics in C or C++?


TR 24733 specifies decimal floating-point math for C++, based on IEEE-754. The TR means that it's a technical report, so it's not part of the C++ standard. GCC says they have a partial implementation. There is currently a proposal in the works to add it to the C++ standard, but that's several years away at best.

链接地址: http://www.djcxy.com/p/85632.html

上一篇: 为什么浮点数不准确?

下一篇: C或C ++中的十进制算术?