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

Implement Pow #21

Merged
merged 3 commits into from
Jun 16, 2018
Merged

Implement Pow #21

merged 3 commits into from
Jun 16, 2018

Conversation

clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Mar 4, 2018

Should be merged after #19, as this PR depends on that one. Fixes #20.

Will need to investigate compile time increases that this change causes.

@clarfonthey clarfonthey changed the title Pow Implement Pow Mar 4, 2018
@clarfonthey
Copy link
Contributor Author

Fixed compile errors; this only increases compile time by .1s on my box so I think this is fine.

src/lib.rs Outdated
Pow::pow(self.clone(), expon)
}
}
impl<'a, T: Clone + Integer + Pow<$unsigned, Output = T>> Pow<&'a $exp> for Ratio<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not need Clone, does it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything requires Clone, even Ratio::new. I'd prefer to keep it for now. We could someday relax this without it being a breaking change, but not the other way.

@vks
Copy link
Contributor

vks commented Apr 10, 2018

This looks good, however it would be nice to have some tests.

@cuviper
Copy link
Member

cuviper commented Jun 16, 2018

Updated the existing test_pow, and changed Ratio::pow per #22.

bors r+

bors bot added a commit that referenced this pull request Jun 16, 2018
21: Implement Pow r=cuviper a=clarcharr

Should be merged after #19, as this PR depends on that one. Fixes #20.

Will need to investigate compile time increases that this change causes.

Co-authored-by: Clar Charr <clar@charr.xyz>
Co-authored-by: Josh Stone <cuviper@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jun 16, 2018

Build failed

@cuviper
Copy link
Member

cuviper commented Jun 16, 2018

Travis timeout without even starting our job.

bors r+

bors bot added a commit that referenced this pull request Jun 16, 2018
21: Implement Pow r=cuviper a=clarcharr

Should be merged after #19, as this PR depends on that one. Fixes #20.

Will need to investigate compile time increases that this change causes.

Co-authored-by: Clar Charr <clar@charr.xyz>
Co-authored-by: Josh Stone <cuviper@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jun 16, 2018

Build succeeded

@bors bors bot merged commit 602a17c into rust-num:master Jun 16, 2018
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.

None yet

3 participants