Commit c0d6e18
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 42b4a1d commit c0d6e18
2 files changed
Lines changed: 32 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
262 | 276 | | |
263 | 277 | | |
264 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
122 | 131 | | |
| 132 | + | |
| 133 | + | |
123 | 134 | | |
124 | 135 | | |
125 | 136 | | |
| |||
0 commit comments