Jump to content

Primality by trial division: Difference between revisions

Fixed up task description
(Fixed up task description)
Line 1:
{{task}}Write a boolean function that tells whether a given integer is prime. Remember that 1 and all non-positive numbers are not prime.
 
Use trial division. Even numbers may be eliminated right away. A loop from 3 to √(n) will suffice, but other loops are allowed.
Implement the simplest primality test, using trial division.
 
=={{header|Ada}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.