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 decomposeIntoDigits #121

Merged
merged 3 commits into from
Jul 3, 2021
Merged

Fix decomposeIntoDigits #121

merged 3 commits into from
Jul 3, 2021

Conversation

JanBobolz
Copy link
Member

The old version decomposed "100" into "[0, 0, 10]" in base 10. Also, it never really threw an exception if the number was too large to write with the given number of digits, it just produced one giant digit to compensate.

The new version does the more usual computation of computing the digits from least significant to most significant.

@JanBobolz JanBobolz added the bug Something isn't working label Jul 3, 2021
@JanBobolz JanBobolz self-assigned this Jul 3, 2021
Copy link
Member

@this-kramer this-kramer left a comment

Choose a reason for hiding this comment

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

Looks good. Do you have a test case to ensure this bug will be detected in the future?

@JanBobolz
Copy link
Member Author

To be honest, I’m just crossing my fingers that the code works now. Also, it doesn’t depend on anything and the code itself is unlikely to change in the future :)

@JanBobolz JanBobolz merged commit 2060fb5 into develop Jul 3, 2021
@JanBobolz JanBobolz deleted the fixDigits branch July 3, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants