ahanmal opened this issue 10 years ago · 1 comments
for (int i = 2; i <= (int)sqrt(givenNumber); i++) { if (givenNumber % i == 0) { return YES; } }
should be:
for (int i = 2; i <= (int)sqrt(givenNumber); i++) { if (givenNumber % i == 0) { return NO; } }
I'll open a PR soon.
Merged.