Repository navigation
Commit 934279e
fix(intword): correct decillion-to-googol gap and carry-over rounding
`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 #356
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f971127 commit 934279e
2 files changed
Lines changed: 32 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
289 | 303 | | |
290 | 304 | | |
291 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
| 139 | + | |
| 140 | + | |
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
| |||
0 commit comments