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 operator for BigDecimal and BigRational #7860

Conversation

jwbuiter
Copy link
Contributor

@jwbuiter jwbuiter commented Jun 5, 2019

Resolves #7680

Since @ananagame closed his PR, I decided to try to implement this for my first contribution.

Instead of an iterative approach, this implementation uses the operators of the underlying BigInt representation to achieve the same results.

I also added tests and tried to format the styles of the tests to match those in the surrounding file.

@jwbuiter jwbuiter closed this Jun 6, 2019
@jwbuiter jwbuiter reopened this Jun 6, 2019
src/big/big_rational.cr Outdated Show resolved Hide resolved
@straight-shoota
Copy link
Member

@jwbuiter could you apply the suggestions? You might've fixed them, but they're not in the branch.

Co-Authored-By: Sijawusz Pur Rahnama <sija@sija.pl>
Co-Authored-By: r00ster <r00ster91@protonmail.com>
@straight-shoota straight-shoota merged commit 8b5a9bf into crystal-lang:master Aug 1, 2019
@straight-shoota
Copy link
Member

Thank you @jwbuiter

dnamsons pushed a commit to dnamsons/crystal that referenced this pull request Jan 10, 2020
)

Co-Authored-By: Sijawusz Pur Rahnama <sija@sija.pl>
Co-Authored-By: r00ster <r00ster91@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigDecimal missing ** method
5 participants