fix(intword): correct decillion-to-googol gap and carry-over rounding - #364
Open
mmaxjr wants to merge 1 commit into
Open
fix(intword): correct decillion-to-googol gap and carry-over rounding#364mmaxjr wants to merge 1 commit into
mmaxjr wants to merge 1 commit into
Conversation
`powers` jumps from decillion (10**33) directly to googol (10**100), so any value in [10**36, 10**100) was chopped into a decillion count that grew arbitrarily large (e.g. 10**50 -> "100000000000000000.0 decillion"), and values that should round up into googol (e.g. 10**100 - 10**93) never carried over. Only advance to the next named unit when the value actually rounds up to it; otherwise there is no unit for that magnitude, so fall back to the plain integer, mirroring how intword() already falls back to a plain value below the smallest unit. Fixes python-humanize#356 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #356
Problem
intword()'spowerstable jumps straight from decillion (1033) to googol (10100), with no unit in between. Any value in [1036, 10100) got chopped into a decillion count that grows arbitrarily large: