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

Fix BigDecimal#power with negative integer #7887

Merged
merged 3 commits into from Aug 15, 2023

Conversation

k77ch7
Copy link
Contributor

@k77ch7 k77ch7 commented Aug 15, 2023

This commits improves precision of power algorithm.
This commits also updates getPrec() of private method to match MRI behavior.

The following test will pass.

  • test_power_without_prec in test/mri/bigdecimal/test_bigdecimal.rb

This commits improves precision of power algorithm.
This commits also updates getPrec() of private method to match MRI behavior.

The following test will pass.
 * test_power_without_prec in test/mri/bigdecimal/test_bigdecimal.rb
@k77ch7 k77ch7 marked this pull request as draft August 15, 2023 12:51
@k77ch7
Copy link
Contributor Author

k77ch7 commented Aug 15, 2023

These snippets match exactly with mri 3.1.3
BigDecimal("987654.3210987654321") ** -987
BigDecimal("0.00070809010203040506") ** -123

@k77ch7 k77ch7 marked this pull request as ready for review August 15, 2023 14:05
@enebo enebo added this to the JRuby 9.4.4.0 milestone Aug 15, 2023
@enebo enebo merged commit 4fc83fb into jruby:master Aug 15, 2023
47 of 48 checks passed
@enebo
Copy link
Member

enebo commented Aug 15, 2023

Only 13 excludes left. Thanks @k77ch7.

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

2 participants