-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add non-panicking variants of pow for integer types #48321
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
767ada2
to
a5bf3c9
Compare
Currently, calling pow may panic in case of overflow, and the function does not have non-panicking counterparts. Thus, it would be beneficial to add those in.
f6acfcd
to
b31ff95
Compare
Squashed and rebased. |
Thanks! Would it be possible perhaps to implement these methods in terms of one another? For example |
It would be possible, though that might incur some performace penalty(haven't benchmarked, so not sure). |
Ah ok yeah that makes sense to me, the loop does indeed seem like it throws a wrench into performance here. In that case... @bors: r+ |
📌 Commit b31ff95 has been approved by |
Add non-panicking variants of pow for integer types Currently, calling pow may panic in case of overflow, and the function does not have non-panicking counterparts. Thus, it would be beneficial to add those in. Closes rust-lang#48291. Relevant tracking issue: rust-lang#48320
@bors: rollup |
Add non-panicking variants of pow for integer types Currently, calling pow may panic in case of overflow, and the function does not have non-panicking counterparts. Thus, it would be beneficial to add those in. Closes rust-lang#48291. Relevant tracking issue: rust-lang#48320
Currently, calling pow may panic in case of overflow, and the function does not have non-panicking counterparts. Thus, it would be beneficial to add those in.
Closes #48291.
Relevant tracking issue: #48320