Skip to content

Fix rounding inconsistency in split totals#32

Merged
Daniel15568 merged 1 commit into
data-centt:mainfrom
Sanjays2402:fix/split-rounding-total
Jul 20, 2026
Merged

Fix rounding inconsistency in split totals#32
Daniel15568 merged 1 commit into
data-centt:mainfrom
Sanjays2402:fix/split-rounding-total

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #4

Rounded proportional shares could add up to less than the requested total. Apply the rounding remainder to the final share so the returned allocations preserve the rounded total; the regression covers split(100, [1, 1, 1]).

Adjust the final allocation by the rounding remainder so proportional splits add back up to the requested total. Add a regression for three equal weights.

@Daniel15568 Daniel15568 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, approved

@Daniel15568
Daniel15568 merged commit 1dd41df into data-centt:main Jul 20, 2026
7 checks passed
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.

Rounding inconsistency in percent_distribute results

2 participants