Skip to content

Added a new Algorithm to check if a number is prime or not. #487

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 6 commits into from
Oct 19, 2018
Merged

Added a new Algorithm to check if a number is prime or not. #487

merged 6 commits into from
Oct 19, 2018

Conversation

Kaiyoto
Copy link
Contributor

@Kaiyoto Kaiyoto commented Oct 19, 2018

Added a new Algorithm to check if a number is prime or not. It takes one + half the amount of iterations of the square root of the number. Returns Boolean value.

Added a new Algorithm to check if a number is prime or not. It takes one + half the amount of iterations of the square root of the number. Returns Boolean value.
@ParthS007
Copy link
Member

This pull request introduces 1 alert when merging 391b948 into 116ab0f - view on LGTM.com

new alerts:

  • 1 for Result of integer division may be truncated

Comment posted by LGTM.com

Changed the 1/2 with a 0.5
Instead of 3, 5, 7 The Loop as checking 2, 4, 6 which would cause all odd numbers to show prime. Fixed by subtracting one.
Github Merged the 2 previous and current version to make a weird file.
@ParthS007
Copy link
Member

This pull request introduces 1 alert when merging c4ebbe0 into 116ab0f - view on LGTM.com

new alerts:

  • 1 for Result of integer division may be truncated

Comment posted by LGTM.com

Changed the 1/2 with a 0.5
@harshildarji harshildarji merged commit b63a111 into TheAlgorithms:master Oct 19, 2018
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.

3 participants