Primes by Trial Division - HP BASIC/V

10 February 2019

HP BASIC/V is structurally the same as IBM PC BASIC; differences are single-character variable names, implicit GOTO after THEN, and array indices are 1-based instead of 0-based.

Square brackets are used for array subscripts, but parentheses are accepted for input and converted.

    1 GOTO 10
    5 C=C+1
    6 GOTO 50
   10 DIM P[1000]
   20 P[1]=2
   25 PRINT P[1]
   30 C=3
   40 FOR F=2 TO 1000
   50 FOR I=1 TO (F-1)
   60 IF (C MOD P[I])=0 THEN 5
   70 NEXT I
   80 PRINT C
   90 P[F]=C
  100 C=C+1
  110 NEXT F
  120 END

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 BASICs

Applesoft BASIC

Atari 2600 BASIC

BBC BASIC

Commodore BASIC

DRI Personal BASIC

HP BASIC/V

IBM 5100 BASIC

IBM PC BASIC

PICK/BASIC

Rocky Mountain BASIC

Sinclair ZX80 BASIC

Spectravideo Compumate

TI 99/4 BASIC

TRS-80 Level 1 BASIC

V-Tech Laser 50

VAX BASIC

Structured BASIC

Amiga BASIC

Dartmouth True BASIC

Microsoft QuickBASIC

Microware Basic09

Topaz S-BASIC