Primes by Trial Division - NIAL

27 September 2023

isprime IS OPERATION Num List { min (Num mod List) > 0 }

primes IS OPERATION NumPrimes {
  Found gets 2 ;
  Cx gets 3 ;
  REPEAT
    ((IF isprime Cx Found THEN Found gets append Found Cx ELSE null ENDIF) (Cx gets Cx + 1))
  UNTIL shape Found = NumPrimes
  ENDREPEAT ;
  Found
}

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026

Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Primes Benchmark Source

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Primes Benchmark Results

Other APL Variants

A+

APL

NIAL