Skip to content

Fix is_prime for values less than two - #191

Merged
ei1333 merged 3 commits into
masterfrom
fix-is-prime-small-values
Aug 11, 2026
Merged

Fix is_prime for values less than two#191
ei1333 merged 3 commits into
masterfrom
fix-is-prime-small-values

Conversation

@ei1333

@ei1333 ei1333 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Return false for values less than 2 in is_prime
  • Add a standalone unittest covering 0, 1, small primes/composites, and larger values

Verification

  • g++ -std=c++17 -I. test/unittest/is-prime.test.cpp -o /tmp/is-prime.test && /tmp/is-prime.test

@ei1333
ei1333 merged commit 118ac95 into master Aug 11, 2026
25 of 26 checks passed
@ei1333
ei1333 deleted the fix-is-prime-small-values branch August 11, 2026 11:27
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.

1 participant