www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - libmpec wrapper

I am working in a D wrapper for libmpdec. It is part of mpdecimal 
is a package for correctly-rounded arbitrary precision decimal 
floating point arithmetic writter by Stefan Krah.

Decimal types are important in applications that require exact 
computations like accounting or finance.

You can find an initial version at


My project offers bindings and a wrapper for using limpdec from D 

*    mpdec.mpdec is a translation of the original header from C 
to D. (This allows you to call the libmpec functions from D).

*    mpdec.decimal is a high-level wrapper over libmpec using the 
features of the D language (like structs and operator 

This work is distributed under the MIT license (see the LICENSE 

Some sample test programs are also provided.

¬°Any help is much appreciated! (like comment, testing, etc.).

I am planning to add this project later to the dub registry.
There are some other pure-D solutions there (like "fixed" or 
"decimal") but seem to be
somewhat buggy or unmaintained.

I believe that limpdec is a high-quality library (used for 
instance by the Python decimal module), and so I think that this 
might be a useful contribution to the D community.
Aug 20 2021