Skip to content

Fix a bug where primes_lt and sieve_lt could panic if the underlying segmented sieve happend to run down past 0. #55

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 7 commits into from
Jun 17, 2024

Conversation

JSorngard
Copy link
Owner

@JSorngard JSorngard commented Jun 17, 2024

Now instead we reuse the base sieve, and read from it at an offset.

@JSorngard JSorngard linked an issue Jun 17, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 87.93103% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.62%. Comparing base (44caa41) to head (a499649).

Files Patch % Lines
src/sieve.rs 79.31% 6 Missing ⚠️
src/generate.rs 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   88.51%   89.62%   +1.11%     
==========================================
  Files          11       11              
  Lines        1123     1157      +34     
==========================================
+ Hits          994     1037      +43     
+ Misses        129      120       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JSorngard JSorngard changed the title Fix a bug where primes_lt and sieve_lt could panic if the segmented sieve happend to run down past 0. Fix a bug where primes_lt and sieve_lt could panic if the underlying segmented sieve happend to run down past 0. Jun 17, 2024
@JSorngard JSorngard merged commit 59d893e into main Jun 17, 2024
8 of 9 checks passed
@JSorngard JSorngard deleted the primes_lt_errors_found branch June 17, 2024 16:28
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.

The segmented sieve panics if upper_limit is less than N
1 participant