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

Improves Precision and Simplifies Allocation Logic #1082

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

tirosh
Copy link
Member

@tirosh tirosh commented Mar 5, 2024

  • Converts all numeric parameters to BigDecimal when any is a BigDecimal, Float, or Rational, enhancing calculation precision.
  • Removes obsolete round-robin penny distribution for a more straightforward allocation approach.

Initially I had noticed a small error in the round-robin distribution logic: #1074

Upon further reflection, I think the reason for introducing the round-robin distribution was lack of precision. By increasing the precision to BigDecimal, the case described in #1033 seems to be solved and the round-robin distribution becomes obsolete.

What do you think of this @semmons99 ?
This #1073 would of course no longer make sense.

Note: The only failing test has nothing to do with my changes, but apparently with the formatting for CHF

- Converts all numeric parameters to BigDecimal when any is a BigDecimal, Float, or Rational, enhancing calculation precision.
- Removes obsolete round-robin penny distribution for a more straightforward allocation approach.
@semmons99
Copy link
Member

running tests. would you mind fixing the CHF test too please?

@tirosh
Copy link
Member Author

tirosh commented Mar 6, 2024

would you mind fixing the CHF test too please?

Fixed the CHF test and pushed the changes. Anything else needed?

@semmons99 semmons99 merged commit d7e7f45 into RubyMoney:main Mar 6, 2024
6 checks passed
@semmons99
Copy link
Member

all good. thanks. will release to rubygems shortly

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