Skip to content

uucore: num_parser: Limit precision when computing 2**exp #7712

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

drinkcat
Copy link
Contributor

@drinkcat drinkcat commented Apr 9, 2025

The number of digits would grow exponentially when large exponents are passed, leading to conversion of numbers like 0x2p1000000 taking forever to compute.

We use exponentiation by squaring to keep the precision within reasonable bounds.

Fixes #7708.

The number of digits would grow exponentially when large exponents
are passed, leading to conversion of numbers like 0x2p1000000 taking
forever to compute.

We use exponentiation by squaring to keep the precision within
reasonable bounds.

Fixes uutils#7708.
@drinkcat drinkcat force-pushed the parse_number_large_hex-fix branch from e9b030d to 4a13f4d Compare April 9, 2025 13:30
Copy link

github-actions bot commented Apr 9, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit 64cf3f5 into uutils:main Apr 10, 2025
68 of 69 checks passed
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.

fuzz_seq_parse_number often hangs
2 participants