-
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
Avoid OverflowError in mpz.__rshift__() #525
base: master
Are you sure you want to change the base?
Conversation
7875018
to
50641b6
Compare
@casevh, second patch removes It's possible to implement this pr in other way, but I think it triggers a bug in the patch. I think that proper support for 64-bit mp_bitcnt_t on win64 1) requires a more work, 2) we should submit patch to the upstream first. |
What bug is triggered in the mp_bitcnt_t patch? A previous bug that I reported upstream was fixed within a few days. |
See failed job: https://github.com/aleaxit/gmpy/actions/runs/11379818079/job/31657941881 It's on Windows, I can't reproduce this. I guess, mpz_fdiv_q_2exp() make some assumptions on max value of the last argument. |
@casevh, I think failure with mp_limb_t mpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int); I don't see an easy fix. What do you think? |
Per the GMP documentation, (the fourth argument) must be in the range 1 to mp_bits_per_limb{}-1. So I think there is a bug somewhere else. I'll try to step through the logic in cfdiv_q_2exp. |
FYI, failed test: |
Closes #524