HP -32S Owner's Manual page 239

Rpn scientific calculator
Table of Contents

Advertisement

Program Listing:
Program Lines:
Description:
Y01 LBL Y
This routine displays the prime number.
Y02 VIEW P
Displays the prime number P.
Bytes and Checksum: 003.0, 9D08
201 LBL Z
This routine adds 2 to P before testing to
see if P is prime.
Z02
2
Z03
RCL+ P
Bytes and Checksum: 004.5, E455
P01 LBL P
This routine stores the input value for P.
P02
STO
P
P03 3
Stores 3 in test divisor, D.
P04
STO
D
Bytes and Checksum: 006.0, 9E38
X01 LBL X
This routine tests P to see if it is prime.
X02
RCL
P
X03
RCL*
D
X04 FP
Finds the fractional part of P+D.
X05 *=0?
Tests for a remainder of zero (number not
prime).
X06GTOZ
If the number is not prime, tries next
possibility.
X07
RCL
P
X08
SQRT
X09
RCL
0
X10 x>y?
Tests to see whether all possible factors
have been tried.
X11GT0Y
If all factors have been tried, branches to
the display routine.
X12 2
Calculates the next possible factor, D + 2.
X13
ST0+ D
14: Miscellaneous Programs
237

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents