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 NumDigits with ensureInitialized #301

Merged
merged 1 commit into from
Dec 31, 2023
Merged

Conversation

zlasd
Copy link
Contributor

@zlasd zlasd commented Nov 24, 2022

Fix #292

The library promises

The zero-value is 0, and is safe to use without initialization

Simply add ensureInitialized at the beginning of NumDigits to ensure zero-value act as NewFromInt(0).

Copy link
Member

@mwoss mwoss left a comment

Choose a reason for hiding this comment

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

Sorry for the late review! :< Thanks for this fix, I completely forgot about it while implementing this helper function.
LGTM!

@mwoss mwoss merged commit 1df8fb3 into shopspring:master Dec 31, 2023
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.

[Bug] (decimal.Decimal{}).NumDigits == 5
3 participants