17–8 Miscellaneous Programs and Equations
File name 33s-English-Manual-040130-Publication(Edition 2).doc Page : 388
Printed Date : 2004/1/30 Size : 13.7 x 21.2 cm
Program Listing:
Program Lines:
(In ALG mode)
Description
This routine displays prime number P.
Checksum and length: AA7A 6
This routine adds 2 to P.
Checksum and length: 8696 21
This routine stores the input value for P.
Tests for even input.
Increments P if input an even number.
Stores 3 in test divisor, D.
Checksum and length: D0B8 87
This routine tests P to see if it is prime.
Finds the fractional part of P
÷
D.
Tests for a remainder of zero (not prime).
If the number is not prime, tries next possibility.