Primality by trial division: Difference between revisions
Content added Content deleted
m (→compact version: added an overbar to the radical.) |
m (→compact version: changed wording in the REXX section header.) |
||
Line 2,267: | Line 2,267: | ||
Programming note: all the REXX programs below show all primes up and including the number specified. |
Programming note: all the REXX programs below show all primes up and including the number specified. |
||
::: If the number is negative, the absolute value of it is used for the upper limit, but no primes are shown. |
|||
::: The ''number'' of primes found is always shown. |
|||
<lang rexx>/*REXX program tests for primality by using (kinda smartish) trial division. */ |
<lang rexx>/*REXX program tests for primality by using (kinda smartish) trial division. */ |
||
parse arg n .; if n=='' then n=10000 /*let the user choose the upper limit. */ |
parse arg n .; if n=='' then n=10000 /*let the user choose the upper limit. */ |