Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roman numerals don't scale well beyond 1,000 #282

Open
haykam821 opened this issue Mar 15, 2024 · 2 comments
Open

Roman numerals don't scale well beyond 1,000 #282

haykam821 opened this issue Mar 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@haykam821
Copy link
Contributor

haykam821 commented Mar 15, 2024

When converting numbers to Roman numerals, the maximum Roman numeral implemented is M:

> 10000 to roman
MMMMMMMMMM
> 100000 to roman
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

Sufficiently big numbers over 1,000 can result in the REPL freezing, and the maximum Roman numeral representation is over 4 million characters long.

Would it make sense to use the overline to represent larger quantities? For example, a combining overline would give a larger buffer before the output becomes nonsense, and a combining double overline would give an even larger buffer.

@haykam821 haykam821 changed the title Roman numerals don Roman numerals don't scale well beyond 1,000 Mar 15, 2024
@printfn
Copy link
Owner

printfn commented Mar 15, 2024

Interesting, I didn't know overlines were used for larger numbers. I agree this would probably make sense to implement.

@printfn
Copy link
Owner

printfn commented Mar 15, 2024

For now I've implemented an upper bound of 100,000, which prevents the REPL from freezing or running out of memory. Adding support for larger numbers with different notation would obviously still be a good idea :)

@printfn printfn added the enhancement New feature or request label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants