-
Notifications
You must be signed in to change notification settings - Fork 7
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
ParserNG should use BigDecimal
instead of double
#30
Comments
The parserng works by default in doubles. What you see is max precision double can get:
What you see would be achieved moving whole parserng to bigdecimal:
and big decimal
Where the cost performance will be notable, I would vote for moveing parserng from double to BigInteger. Still it is very huge step. |
I would probably recommend to change subject of this issue: "parserng shoud use bigdecimal instead of doubles" , but still, I think its not going to be solved anytime soon. |
btw, future 0.1.9 (pom is not yet bumped) have sum and gsum rewritten to biginteger:
(prod is still in double):
So gsum/summ can help you to workaroudn this problem.. somehow... |
I hope to draft readme.md changes for 0.1.9 during this week, so @gbenroscience could release. |
BigDecimal
instead of double
https://github.com/ezylang/EvalEx-big-math How about delegating |
Well there is plenty of math libraries, each with its pros and cons. Some ar fast, some ar not, some have some functins, some dont, some are double, some are bigdecimal.... I like pareserng for its strightforward approach and easy extendability. To have math library(parserng) calling another math library (evalex-bigmath) would be very weird step. |
Thanx for fixing me to BigDecimal. My typo. Had BigDecimal in mind. |
What I'm saying is that there are cases like |
Hello @JellyBrick , thanks for using @JellyBrick , However, we can define a limited Many important classes are based on With time, then we can contribute functions that efficiently and accurately compute the trig functions, the log functions etc in Once this is achieved, we can then allow What do you think, @judovana and @JellyBrick ? |
Actually, there is a class |
Can you provide examples of PolynomialExpression please? The BigMathExpression is interesting idea. Maybe MathExpression can have as parameter factory method, which will be responsible for sting->number convertions? like Before actuallys tarting anything, would be nice to have performance comparsion double x Double x BigDecimal. Maybe the difference will bs super trivial. |
So sorry. I took a look at
Did some research online though, it seems the general consensus is that |
I have bigger concerns about |
Considering the fact that I pray God that a time would come when I would have enough time on my hands to do a speed optimized refactor of ParserNG, moving all of ParserNG to BigDecimal is definitely not attractive to me.
|
Yup. Sure. Crossing fingers for you, and agreeing on double x Double. |
Hi @judovana and @JellyBrick, here is PR #32 |
Test code
Expect
298368859587470504923124286
Result
298368859587470500000000000
The text was updated successfully, but these errors were encountered: