Jump to content

Primality by trial division: Difference between revisions

m
→‎compact version: added verbiage to the REXX section header.
(Added Smalltalk)
m (→‎compact version: added verbiage to the REXX section header.)
Line 2,498:
 
Also, it was determined that computing the (integer) square root of the number to be tested in the   '''isPrime'''  
<br>function slowed up the function &nbsp; (for all three REXX versions)., &nbsp; however, for larger numbers of &nbsp; '''N''', &nbsp; it would
<br>be faster.
<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. */
Cookies help us deliver our services. By using our services, you agree to our use of cookies.