[decimal] Proposed portable implementation of std::decimal

Hi, I believe that a portable implementation of the proposed std::decimal (eg Decimal Types for C++ <http://tiny.cc/63ovcw> for older draft) would be useful. Since the standard specifies a class, a library should be able to achieve close to full compliance. At the moment I believe only gcc supports this. I'm currently working on this for my own purposes, and if there is sufficient interest (and guidance!) might try to expand it into a draft submission. Roadmap: 1. Implement std::decimal (see gcc version, for example) using Intel FP Decimal, DecNumber, native gcc, (maybe .NET Decimal depending on how close it is to complying with interface) 2. Some preprocessor trickery to make it easy to compile all implementation as separate classes (eg extension::decimal::Intel::decimal64), or a given implementation as the 'one true' class (extension::decimal::decimal64). This means unit tests and performance tests can be written using one implementation against another, and for production code, a given implementation can be used under the hood depending on the architecture. 3. Create performance and standards-compliance benchmarks for implementations. 4. Choose default implementation for each supported architecture, based on benchmarks. The above is a personal roadmap, of which a subset may be of interest to the boost community. Please let me know if you think this would be of value, and in particular if you would like to be involved in creating / testing / using this. Regards, Josh.

On Mon, Apr 16, 2012 at 6:26 PM, Josh Quigley <0zeroth@gmail.com> wrote:
Hi,
I believe that a portable implementation of the proposed std::decimal (eg Decimal Types for C++ <http://tiny.cc/63ovcw> for older draft) would be useful. Since the standard specifies a class, a library should be able to achieve close to full compliance. At the moment I believe only gcc supports this.
I'm currently working on this for my own purposes, and if there is sufficient interest (and guidance!) might try to expand it into a draft submission.
I'm interested. Seems like it would be a great addition to Boost. Wouldn't http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2849.pdf be a better starting place? --Beman

I believe that a portable implementation of the proposed std::decimal
(eg Decimal Types for C++ would be useful.
I'm currently working on this for my own purposes, and if there is sufficient interest (and guidance!) might try to expand it into a draft submission.
I'm interested. Seems like it would be a great addition to Boost.
I'm also interested. Best regards, Chris.

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christopher Kormanyos Sent: Wednesday, April 18, 2012 10:05 PM To: boost@lists.boost.org Subject: Re: [boost] [decimal] Proposed portable implementation of std::decimal
I believe that a portable implementation of the proposed std::decimal
(eg Decimal Types for C++ would be useful.
I'm currently working on this for my own purposes, and if there is sufficient interest (and guidance!) might try to expand it into a draft submission.
I'm interested. Seems like it would be a great addition to Boost.
Of course this is definitely something Boost needs in its tool chest. But to 'sell' it to Boost, I think it is important to relate to commercial offerings and previous proposals to WG21 C++ Standards. So say how and why you have done it differently? Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
participants (4)
-
Beman Dawes
-
Christopher Kormanyos
-
Josh Quigley
-
Paul A. Bristow