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 improved implementation of power operation #358

Merged
merged 2 commits into from Apr 2, 2024
Merged

Add improved implementation of power operation #358

merged 2 commits into from Apr 2, 2024

Conversation

mwoss
Copy link
Member

@mwoss mwoss commented Apr 2, 2024

PR adds an improved implementation of the Pow method. It also adds three new methods - PowWithPrecision, PowInt32, and PowBigInt.
PowWithPrecision can be used for calculating powers with high, specific precision. PowInt32 and PowBigInt can be used for more performant calculation of decimal powers in case the exponent is simply an integer.

It took me some time to implement them as it was quite a difficult task, especially when we care about correctness and high precision. I also had to implement natural exponent and natural logarithm implementation for that.

* Adjust Pow implementation
* Add PowWithPrecision method
* Add PowInt32 method
* Add PowBigInt method
@mwoss mwoss merged commit 78289cc into master Apr 2, 2024
6 checks passed
@mwoss mwoss deleted the pow branch April 2, 2024 22:16
epelc pushed a commit to greatcloak/decimal that referenced this pull request Apr 7, 2024
* Adjust Pow implementation
* Add PowWithPrecision method
* Add PowInt32 method
* Add PowBigInt method
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

1 participant