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

(re-) Add pow functionality for rational #25

Open
jeking3 opened this issue Jul 14, 2018 · 4 comments
Open

(re-) Add pow functionality for rational #25

jeking3 opened this issue Jul 14, 2018 · 4 comments

Comments

@jeking3
Copy link
Collaborator

jeking3 commented Jul 14, 2018

See: #24

In 2015 a pull request added pow() and reciprocal(). In 2018 it was reviewed by CMT and reciprocal() was found to be unnecessary. This left boost::pow() for rational, however it introduced an issue resolving std::pow from within boost namespaces. This happened close to the 1.68.0 release (during beta) so it was removed.

Originally recommend looking at adding operator ^= as a modifying operator to raise the rational value to an integer exponent. In addition operator ^ could take an existing rational and raise it to an exponent, returning a new rational. - note comments below.

@swatanabe
Copy link
Contributor

swatanabe commented Jul 14, 2018 via email

@jeking3
Copy link
Collaborator Author

jeking3 commented Jul 14, 2018

I was thinking the commonly used mathematic notation of (x^2) would be reasonable here, however the precedence issue is interesting.

@jeking3
Copy link
Collaborator Author

jeking3 commented Aug 1, 2018

I think perhaps just moving pow into another namespace (ideally boost::rational) would resolve the issue sufficiently and avoid the collision that was happening.

@swatanabe
Copy link
Contributor

swatanabe commented Aug 1, 2018 via email

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

No branches or pull requests

2 participants