-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat: remove twinPrime
#1641
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
feat: remove twinPrime
#1641
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1641 +/- ##
==========================================
- Coverage 83.94% 83.92% -0.02%
==========================================
Files 377 376 -1
Lines 19727 19698 -29
Branches 2917 2911 -6
==========================================
- Hits 16559 16532 -27
+ Misses 3168 3166 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improves coverage of the existing implementation, but I think the existing implementation has a bug: According to Wikipedia
A twin prime is a prime number that is either 2 less or 2 more than another prime number
So the (a) twin prime of 7
should be 5
.
What should then be the I have to admit that I did not get this function is supposed to do. It would be more natural to have a function like |
I think either 3 or 7 would be fine. We may also remove this function entirely, or replace it with an "is twin prime" variant as you suggest, IMO. It's just confusing (and trivial) as is. |
I will remove it. |
* tests: add missing test of `twinPrime` * feat: remove `twinPrime`
Describe your change:
This PR removes the function
twinPrime
as suggested in: #1641 (comment)This PR adds a test covering this line:JavaScript/Maths/TwinPrime.js
Line 23 in 4a4ed57
And reorganizes existing tests.Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.