On Thursday, 21 December 2017 at 13:59:28 UTC, Jack Stouffer
wrote:
A couple of months ago, Andrei noted that a donor asked for a
precise decimal type for D specifically:
https://forum.dlang.org/post/[email protected]. 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!
That are fantastic news. Thanks for working on this topic.
Is it possible to define a decimal type with a defined scale and
precision?
From the examples and the documentation I am not sure whether it
is possible.
Kind regards
Andre