Primality by trial division: Difference between revisions

m
Revert extra text added to description in one of the previous edits
m (updated FunL)
m (Revert extra text added to description in one of the previous edits)
Line 1:
{{task|Prime Numbers}}Write a boolean function that tells whether a given integer is prime. Remember that 1 and all non-positive numbers are not prime.
 
fu
Use trial division. Even numbers over two may be eliminated right away. A loop from <span style="font-family:serif">3</span> to <span style="font-family:serif">√n</span> will suffice, but other loops are allowed.
 
Anonymous user