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.
Fixes #356.
intword()currently formats values between 10^36 and a googol as huge decillion counts (e.g.intword(10**50)→'100000000000000000.0 decillion'), and the integer-ratio rounding carry does not fire across the final ×10 step.This change adds the standard short-scale names for 10^36–10^99 (undecillion … duotrigintillion) to
powers/human_powers, so:intword(10**50)→'100.0 quindecillion'intword(10**99)→'1.0 duotrigintillion'intword(10**100 - 10**93)→'1.0 googol'(the existing carry now fires across the final step)The existing test that pinned the gap (
"The documented decillion..googol gap must be left untouched") is updated, since the issue explicitly asks for the gap to be fixed.Tests:
python -m pytest→ 749 passed, 110 skipped (baseline on main @ 392aef7: 746 passed).Pre-existing, unchanged by this PR (noted for honesty, out of scope):
intword(10**400)raisesOverflowError("int too large to convert to float") — reproduced on the unmodified baseline.