-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
chore: Make pow
use early return
#1706
Conversation
I went with the approach of just stealing the code out from |
Could you just call |
I would have to do what alex was saying of |
Yep, you'd need to do that. The incref just goes in the middle. |
Also is this breaking given |
Yeah, certainly that too. It's probably worth it to separate them into two PRs, one that does early return, and the other that changes the squaring of rationals. Do you want to let this PR be the early return one and you can open another after with the behavior change? |
👍 |
db52de2
to
5604646
Compare
I reverted those commits after this gets merged I will add that on a separate pr. |
This pr refactors
pow
to use early return.This also adds a small optimization to
Rational**Int
Cases.