Skip to content
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 checked_pow function #162

Merged
merged 1 commit into from
Feb 6, 2016
Merged

Add checked_pow function #162

merged 1 commit into from
Feb 6, 2016

Conversation

est31
Copy link
Contributor

@est31 est31 commented Feb 3, 2016

Implements a checked_pow function which does the same as pow, just with overflow checks.

And, similar to #152 and #153, the function uses references instead of cloning.

Adds a little macro to spare code repetition. Its scoped to the function so nothing gets polluted.

@cuviper
Copy link
Member

cuviper commented Feb 6, 2016

Looks good -- it's nice that you mimicked pow so closely.
@homu r+ 3c5ecdc

@homu
Copy link
Contributor

homu commented Feb 6, 2016

⚡ Test exempted - status

@homu homu merged commit 3c5ecdc into rust-num:master Feb 6, 2016
homu added a commit that referenced this pull request Feb 6, 2016
Add checked_pow function

Implements a `checked_pow` function which does the same as `pow`, just with overflow checks.

And, similar to #152 and #153, the function uses references instead of cloning.

Adds a little macro to spare code repetition. Its scoped to the function so nothing gets polluted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants