-
Notifications
You must be signed in to change notification settings - Fork 40
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
Issue with larger scales? #58
Comments
When I debug into the function, the result is calculated as follows: MathContext mc = new MathContext(mathContext.getPrecision() + 6, mathContext.getRoundingMode());
BigDecimal result = pi(mc).divide(TWO, mc).subtract(asin(x, mc));
doing the calculation without raising the precision by 6 digits, I get the correct result 0. |
I think this is a problem of the standard I noticed that it does not round values that are closer to zero than the desired precision down to zero but leaves them as they are. I am considering to change my private
This should fix your issue. |
Thank you for the quick reply and the workaround. Seems to work for me. |
I'm currently working on using your excellent library for my EvalEx project.
While porting the acos() function, I came to some kind of rounding problems, I guess.
Given this code:
it will not print 0 as expected, but it prints out 0.0000000000000000000000000000000000000000000000000000000000000000000000001
This only happens, when I use a scale >= 60 in the MathContext.
Is this a problem of big-math or BigDecimal?
The text was updated successfully, but these errors were encountered: