Skip to content

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Mar 3, 2020

We already had Pow for references, so the default call doesn't consume
your allocation, but this wasn't sufficient for uses like BigRational.
Now we do implement it by value, and have also added a new inherent
method pow(&self, exp: u32) that takes precedence. That exponent type
matches the same method on primitive integers, and is likely sufficient
for most use cases.

Fixes #106

cuviper added 2 commits March 2, 2020 18:14
We already had `Pow` for references, so the default call doesn't consume
your allocation, but this wasn't sufficient for uses like `BigRational`.
Now we do implement it by value, and have also added a new inherent
method `pow(&self, exp: u32)` that takes precedence. That exponent type
matches the same method on primitive integers, and is likely sufficient
for most use cases.

Fixes rust-num#106
@cuviper
Copy link
Member Author

cuviper commented Mar 3, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 3, 2020

Build succeeded

@bors bors bot merged commit 7f334ee into rust-num:master Mar 3, 2020
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.

implement Pow for BigInt

1 participant