-
Notifications
You must be signed in to change notification settings - Fork 86
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
Can not temporarily change the current context settings #540
Comments
Could you reproduce this with latest stable version (tutorial describes one)? I don't think 2.1.x is maintained anymore. |
Many thanks, I test it using gmpy2 2.2.1, the example in tutorial works. I have another question
I create a context with RoundDown mode, and call the div method under this context, but I still get 0.10000000000000001 which is the default round to the nearest result. Many thanks! |
Ah, that's a bug, thanks. Context argument actually not passed. Will fix. |
As described in the Tutorial, the following code in the with statement should work with precision = 100 and outside with statement should work with precision = 53(default)
However, it prints
It seems 'with context(precision=100)' change the global context and in the with statement, +20 change the context temporarily.
I change the code and put precision = 100 inside with statement , result becomes reasonable.
My gmpy2 version is 2.1.5 from conda-forge
The text was updated successfully, but these errors were encountered: