Uh oh!
There was an error while loading. Please reload this page.
improved prime_check in math modules - #6044
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| return True | ||
| elif number < 2 or not number % 2: | ||
| # Negatives, 0, 1 and all even numbers are not primes | ||
| elif number < 2 or not number % 2 or number % 3 == 0: |
There was a problem hiding this comment.
| elifnumber<2ornotnumber%2ornumber%3==0: | |
| elifnumber<2ornumber%2==0ornumber%3==0: |
There was a problem hiding this comment.
What about numbers like 25, 35, 65 etc ?
There was a problem hiding this comment.
Those numbers are divisible by 5 6k-1 we are starting our loop with 5
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Lakshmikanth2001
commented
Jul 10, 2022
please review my changes and give your valuable feed back |
poyea
commented
Jul 11, 2022
Related #6228 |
poyea
left a comment
There was a problem hiding this comment.
Thank you for your pull request!🤩
I'd approve this because this uses one of the properties - I can't tell if it's intuitive or not though
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.