Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status on std.decimal for Phobos #6

Closed
wilzbach opened this issue Mar 30, 2016 · 5 comments
Closed

status on std.decimal for Phobos #6

wilzbach opened this issue Mar 30, 2016 · 5 comments

Comments

@wilzbach
Copy link

I would be interest in the status of this project. I saw that those were your big todos.

Continue implementation and testing of the decimal32, decimal64 and
decimal128 types.

How far are you with this?

Replace my "extended integer" implementation with std.bigint. I haven't
done this before because were a few things that std.bigint doesn't do
(or didn't do -- I haven't checked in a while).

What is missing from std.bigint?

@andersonpd
Copy link
Owner

On 30-Mar-16 12:22 AM, Seb wrote:

I would be interest in the status of this project. I saw that those
were your big todos.

Continue implementation and testing of the decimal32, decimal64 and
decimal128 types.

How far are you with this?

Replace my "extended integer" implementation with std.bigint. I
haven't
done this before because were a few things that std.bigint doesn't do
(or didn't do -- I haven't checked in a while).

What is missing from std.bigint?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6

I have been working on other number sets for the last few months so
haven't advanced much on decimals, but I'll be back working on them in
April.

Overall, the decimal number set is in good shape except for some math
routines. All arithmetic and conversion and classification routines work
well and have been thoroughly tested.

The arbitrary-precision decimal module(s) are complete. Most of the math
routines (log, exp, trig, etc.) are implemented but are not all in final
form. There are some numerical issues in some -- they will not be
correct in some instances (usually at large range values that must be
correctly reduced).

32- and 64- and 128- bit decimals are working in that there are decimal
contexts defined for them and the conversion to/from arbitrary
precision decimals for arithmetic are implemented. There are some
efficiencies that are available (e.g., using 64-bit long integers for
coefficients) that are not fully implemented.

The ongoing problem with std.bigint is that CTFE is not available for
the 32-bit Windows version. Because of this eris.decimal will not
compile with std.bigint. The fundamental issue is that std.bigint uses
assembly language routines for speed-up in the 32-bit Windows versions
and asm instructions cannot be evaluated at compile time.

I have, as noted, created a separate big integer type which I am sure is
not as fast as std.bigint, but it is correctly implemented. I just hate
to see two different bigint implementations in phobos, so I have not
pushed to move my eris.decimal to std.decimal until std.bigint is modified.

There was some talk (months ago) about minimal modification to
std.bigint, by adding a compiler switch or something to bypass the asm
statements if selected. I haven't heard any more. I don't think Don
Clugston is intending to make the change and I haven't heard of anyone
else stepping up. I don't think I'm the one to do it.

I'll look at the code and give you more specific answers as to what's
working, what needs work, and what's not ready for release.

Thanks for your interest. If you have any specific applications in mind,
let me know and we can work toward them first.

Paul

@andre2007
Copy link

I am not sure, but I think, there is a compiler switch (version) statement in std.internal.math.biguintcore.

version(D_InlineAsm_X86) { import std.internal.math.biguintx86;}
else{ import std.internal.math.biguintnoasm;}

Is this somethink, which you can reuse for std.decimal?

https://github.com/dlang/phobos/blob/master/std/internal/math/biguintcore.d#L36

Kind regards
André

@wilzbach
Copy link
Author

Thanks for your interest. If you have any specific applications in mind,
let me know and we can work toward them first.

Yes I want to push the scientific capabilities of D ;-)
Btw if you are interested, we are currently trying to bundle our forces behind the DlangScience project and it's flagship mir.

so I have not pushed to move my eris.decimal to std.decimal until std.bigint is modified.

That's a shame :/

I am not sure, but I think, there is a compiler switch (version) statement in std.internal.math.biguintcore.

Did this help you?

@zaydek-old
Copy link

zaydek-old commented May 27, 2017

I'd also like to follow-up and ask – what is the current status of std.decimal? Thank you.

@wilzbach
Copy link
Author

what is the current status of std.decimal?

std.decimal will never happen as Phobos is feature-frozen.

However, you can either use this dub module or the decimal dub package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants