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

Use a higher default precision for BigDecimal#power and #** #171

Merged

Conversation

jeremyevans
Copy link
Contributor

When a fractional power is given, increase the precision if the
precision isn't specified via power's second argument:

Float: increase by 15 (rough number of decimal precision in float)
BigDecimal: increase by adding similar precision modifier as done to
calculate the base precision.
Rational: double the precision, since a BigDecimal is created, but
the created BigDecimal uses the same precision.

Increasing the precision for these power calculations has the obvious
tradeoff of making the calculations slower.

Fixes Ruby Bug #17264

When a fractional power is given, increase the precision if the
precision isn't specified via power's second argument:

Float: increase by 15 (rough number of decimal precision in float)
BigDecimal: increase by adding similar precision modifier as done to
            calculate the base precision.
Rational: double the precision, since a BigDecimal is created, but
          the created BigDecimal uses the same precision.

Increasing the precision for these power calculations has the obvious
tradeoff of making the calculations slower.

Fixes Ruby Bug #17264
@mrkn mrkn force-pushed the higher-default-power-precision-ruby-bug-17264 branch 2 times, most recently from 0477cd5 to a3e74fe Compare December 14, 2020 06:22
@mrkn mrkn force-pushed the higher-default-power-precision-ruby-bug-17264 branch from a3e74fe to 4b4d0f7 Compare December 14, 2020 06:39
@mrkn
Copy link
Member

mrkn commented Dec 14, 2020

I ignore the results of macOS workers because these workers are unstable this week.

@mrkn mrkn merged commit 47cfe75 into ruby:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants