Hacker News new | ask | show | jobs
by finchisko 3134 days ago
It might be late and me being tired, but isPrime function will return false for 1 and any other prime? Shouldn't it be true when function is called isPrime?
1 comments

When a test is contrapositive, it's actually testing for composites. So technically, it should output True for composite but then, the name isPrime doesn't do justice. So I changed the outputs to strings 'Prime' and 'Composite'.