|
Boost : |
From: Martin (adrianm_at_[hidden])
Date: 2005-01-12 02:03:31
> It isn't clear yet. It is possible that C will treat the three decimal
> types as built-ins, while C++ will provide a library solution. That is
> probably unlikely, but at this early stage it is still possible.
2 reasons why I would like to see it as a library in c++ (probaly based on
some underlying __decimal64 type)
1. The rounding policy is not part of the decimal object so it must be some
kind of global setting. To avoid having the same issues as with setlocale
(i.e. not thread safe) a library solution could at least handle the locking.
2. The fixed precison is part of the object but how do you specify it. In C I
assume the solution would be something like
decimal64 f = decimal_fixed_precision(5); // f now got 5 fixed decimals
or
decimal64 f = 1.2DF5; // last digit specifies number of fixed decimals
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk