Re:Primes and Primality Testing
by finchisko on Saturday November 18, 2017 @11:11AM
(#15729524)
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?
[ Parent
| on HN ]
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'.