Skip to content

intword: name every short-scale power up to googol (fixes the decillion gap) - #1

Merged
lethevinh merged 1 commit into
mainfrom
fix/issue-356-intword-gap
Sep 21, 2026
Merged

lethevinh merged 1 commit into
mainfrom
fix/issue-356-intword-gap

Conversation

@lethevinh

Copy link
Copy Markdown

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_powers now 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.
  • The existing integer-ratio carry now also fires across the final 10**99 → 10**100 step: intword(10**100 - 10**93)'1.0 googol'.
  • Tests: test_intword_powers expectations updated for the now-named range and extended with 10**50, 10**99, near-googol carry; test_intword_rounding_rollover mantissa 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 pytest749 passed, 110 skipped (baseline at pin 392aef7: 746 passed) — Python 3.12, offline.

Pre-existing limitation observed but out of scope: intword(10**400) raises OverflowError (float() conversion) at the pin as well — unchanged by this diff.

This PR targets the osalks fork deliberately: the adopting workspace (osalk-company CS-B1) records fork-level evidence first; upstream submission is deferred to a separate human decision. No upstream tracker traffic was generated.

…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
@lethevinh
lethevinh merged commit cc0ab31 into main Sep 21, 2026
@lethevinh
lethevinh deleted the fix/issue-356-intword-gap branch September 21, 2026 08:26
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.

1 participant