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

fix: Handle 6k + 1 candidates properly #943

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Conversation

vadorovsky
Copy link
Contributor

  • Before this change, calling find_next_prime with a candidate which satisfies 6k + 1 pattern did not work. This pattern was only later in the loop, but not for the original n argument.
  • Use u32 as a type for n. It's safe to convert u32 into f64 without precission loss.

* Before this change, calling `find_next_prime` with a candidate which
  satisfies `6k + 1` pattern did not work. This pattern was only
  later in the loop, but not for the original `n` argument.
* Use `u32` as a type for `n`. It's safe to convert `u32` into `f64`
  without precission loss.
@vadorovsky vadorovsky force-pushed the vadorovsky/prime-fix branch from 6b3b686 to 0547139 Compare July 3, 2024 03:02
@ananas-block ananas-block merged commit f0a7b5b into main Jul 3, 2024
13 checks passed
@ananas-block ananas-block deleted the vadorovsky/prime-fix branch July 3, 2024 03:55
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.

2 participants