Boost logo

Boost :

From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2008-06-10 17:19:40


Mårten wrote:
>Is there some work been done on implementing a boost::decimal class?
>
>If there isn't my guess is that this would be very useful to C++ >programmers
>out there if boost could provide this (we sure would dance with joy!). I
>would like to help but frankly I lack the competence on how to implement a
>decimal class efficiently and with the robustness it needs.
>
>A decimal class would be very useful for ERP and Financial systems as in
>many cases of the typical customers work with the decimal system instead of
>the binary system. It's hard to motivate for the customers why:

See proposal for decimal built in types in C (and by extension C++):

http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1176.pdf

, which will be available in ICC 11 according to the beta release notes that passed my desk this morning:

(quoting the appendix relevant to new features in ICC 11.0 c++ compiler)

* C++ lambda function
Lambda functions are considered to be part of "C++0x" - the next update of the C++ standard. This feature in particular will facilitate working with template libraries like STL and Intel® Threading Building Blocks

* Additional "C++0x" features
The switch -std=c++0x (Linux*/Mac OS*) and /Qstd=c++0x (Windows*) enables a couple of features which are considered to be part of the future C++ standard "C++0x". This includes static assertions, RVALUE references, C99-compliant preprocessor, __func__ predefined identifier and more. The feature list corresponds to the functionality offered by the switch -std=c++0x of the GNU GCC 3.4 compiler. See http://gcc.gnu.org/gcc-4.3/cxx0x_status.html for details

* Diagnostics support of multi-threading
Using switch "-diag-enable thread" will turn on front-end diagnostics useful to parallelize a program for multi-threading. In particular warnings about references to statically allocated variables, assignments to statically allocated variables and address references of statically allocated variables will be displayed.

* Implementation of the C++ datatype valarray using optimized Intel® IPP calls.
The STL (Standard Template Library) of C++ defines valarray as one of the standard template containers. This is useful, for example, for numerical high-performance data processing. The C++ compiler will support a valarray implementation which uses fast Intel® IPP routines to implement arithmetic, transcendental and logical operations on valarray objects. The Intel® IPP library has to be installed too to use this feature.

* Decimal Floating Point (DFP) Data Type Support
The C++ compilers will support the new DFP data type classes (Decimal32, Decimal64, Decimal128) and the corresponding arithmetic operations to enable decimal arithmetic. For details see the IEEE* 754R standard and the ISO/IEC document N1176 at http://www.open-std.org/JTC1/SC22/WG14

(end quote)

Note that decimal floating point is effectively a feature of the language as compilers gear up to support the related proposal for the standard with libraries that ship with the compiler. Mårten's question might be better directed to the open source gcc development community than boost, since this ball is in their court.

Thanks,
Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk