Skip to content

fix: raise NumOutOfRangeError from tenfn for out-of-range magnitudes#244

Open
SAY-5 wants to merge 2 commits into
jaraco:mainfrom
SAY-5:fix/tenfn-num-out-of-range
Open

fix: raise NumOutOfRangeError from tenfn for out-of-range magnitudes#244
SAY-5 wants to merge 2 commits into
jaraco:mainfrom
SAY-5:fix/tenfn-num-out-of-range

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 21, 2026

Copy link
Copy Markdown

tenfn indexes mill directly on the tens == 1 branch, so values with magnitude beyond the table (e.g. 10**40) leak IndexError instead of the documented NumOutOfRangeError. Routing the lookup through self.millfn(mindex) matches the other branch and the rest of the call sites. Closes #242.

@SAY-5

SAY-5 commented Jun 17, 2026

Copy link
Copy Markdown
Author

Gentle ping. This raises NumOutOfRangeError from tenfn for out-of-range magnitudes instead of letting an IndexError surface. Let me know if any changes would help.

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.

number_to_words leaks IndexError instead of NumOutOfRangeError for huge inputs

1 participant