Proposal for a standard Decimal type in alpha

Jack Stouffer jack at jackstouffer.com
Thu Dec 21 13:59:28 UTC 2017


A couple of months ago, Andrei noted that a donor asked for a 
precise decimal type for D specifically: 
https://forum.dlang.org/post/osnema$d5s$1@digitalmars.com. I've 
also heard this asked for many times, so I decided to start work 
on a library for eventual proposal to Phobos.

I just finished getting the type into an alpha version, and I 
wanted to solicit people's opinions on the API and if I'm heading 
in the right direction with this.

The dub page: https://code.dlang.org/packages/stdxdecimal

The docs: https://jackstouffer.github.io/stdxdecimal/

What you can do so far:

* Control behavior with a Hook type a-la 
std.experimental.checkedint
* Addition, subtraction, multiplication, division
* Construction from a strings and built-in number types

For the full list of planned features, see: 
https://github.com/JackStouffer/stdxdecimal

Please let me know what you think!


More information about the Digitalmars-d-announce mailing list