Anonymous user
Semiprime: Difference between revisions
m
→version 3, with memoization: changed wording in the 3rd REXX section header.
m (→version 2: changed the font size of both output (windows).) |
m (→version 3, with memoization: changed wording in the 3rd REXX section header.) |
||
Line 1,917:
This REXX version is overt 20% faster than version 2 (when in the ''millions'' range).
If the 2<sup>nd</sup> argument ('''top''') is negative (it's absolute value is used), individual numbers in the range aren't shown, but the ''count'' of semiprimes found is shown.
It gets its speed increase by the use of memoization of the prime numbers found, an unrolled primality (division) check, and other speed improvements.
<lang rexx>/*REXX program determines if any integer (or a range of integers) is/are semiprime. */
parse arg bot top . /*obtain optional arguments from the CL*/
|