intword: name every short-scale power up to googol (fixes the decillion gap) - #1
Merged
Merged
Conversation
…on gap) Values between 10**36 and a googol used to render as enormous decillion counts (e.g. intword(10**50) -> '100000000000000000.0 decillion'), and a value just below a googol never carried to '1.0 googol'. Extending powers/human_powers with the standard short-scale names for 10**36-10**99 (undecillion through duotrigintillion) gives every magnitude a unit and lets the existing integer-ratio carry fire across the final 10**99 -> 10**100 step as well. Upstream issue: python-humanize#356
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.
Summary
Fixes the still-open part of python-humanize#356: every value between 10**36 and a googol used to render as a giant decillion count (
intword(10**50)→'100000000000000000.0 decillion'), and a value just below a googol never carried to'1.0 googol'.Upstream PR python-humanize#346 already fixed the carry between adjacent named powers; the decillion→googol naming gap itself stayed open (the issue remains open upstream, with PRs python-humanize#364/python-humanize#400/python-humanize#401 closed unmerged).
What changed
powers/human_powersnow carry the standard short-scale names for 10**36–10**99 (undecillion … duotrigintillion), so every magnitude has a unit and the mantissa never exceeds 999.x.intword(10**100 - 10**93)→'1.0 googol'.test_intword_powersexpectations updated for the now-named range and extended with10**50,10**99, near-googol carry;test_intword_rounding_rollovermantissa guard widened to the full range.New
NS_msgids fall back to English in untranslated locales (standard gettext behaviour).Verification (repo's own suite)
python -m pytest→ 749 passed, 110 skipped (baseline at pin 392aef7: 746 passed) — Python 3.12, offline.Pre-existing limitation observed but out of scope:
intword(10**400)raisesOverflowError(float()conversion) at the pin as well — unchanged by this diff.