Primes by Trial Division - Topaz S-BASIC

21 December 2017

There's almost two orders of magnitude difference in performance between the INTEGER and FIXED (BCD) data types.

VAR count, found, index = INTEGER
DIM INTEGER primes(100)

count = 2
found = 0
index = 0

WHILE found < 100 DO BEGIN
    PRINT count
    primes(found) = count
    found = found + 1
5   count = count + 1
    index = 0
    REPEAT BEGIN
        IF (count-(count/primes(index))*primes(index)) = 0 THEN GOTO 5
        index = index + 1
    END UNTIL index = found
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

Structured BASIC

Amiga BASIC

Dartmouth True BASIC

Microsoft QuickBASIC

Microware Basic09

Topaz S-BASIC

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