the program calculates 5 digits at a time. enter decimal place of the
start digit and XEQ "DPI"
for example, 1 XEQ "DPI" will give 14159. press
R/S for the next 5 digits and so on.
here is another example, 999 XEQ "DPI" will compute the
1000'th to 1005'th digits of π (accounting for the 3 at the start). the
eventual answer is: 89380 |
LBL "DPI"
STO 22
LBL 25
XEQ 24
1e5
*
INT
STOP
5
ST+ 22
RCL 22
GTO 25
LBL 24
STO 17
20
+
.8847
*
INT
STO 16
3
*
LN
2
LN
/
INT
RCL 16
+
RCL 17
-
STO 12
0
STO 13
RCL 12
X<=0?
GTO 09
2
RCL 12
Y^X
STO 8
2
RCL 12
1
+
2
/
INT
Y^X
STO 9
0
STO 11
1
STO 10
STO 7
STO 15
RCL 17
CHS
STO 6
LBL 10
1
CHS
STO 1
RCL 15
STO 0
XEQ 11
RCL 0
RCL 15
2
*
1
-
*
RCL 7
XEQ 18
STO 7
1
STO 1
RCL 15
9
*
3
-
STO 0
XEQ 11
RCL 0
RCL 10
XEQ 18
STO 10
1
STO 1
RCL 15
3
*
2
-
STO 0
XEQ 11
RCL 0
RCL 10
XEQ 18
STO 10
RCL 6 |
X<=0?
GTO 12
RCL 8
RCL 10
XEQ 19
RCL 7
XEQ 18
2
RCL 12
RCL 6
-
Y^X
RCL 15
25
*
3
-
*
XEQ 18
RCL 11
+
RCL 8
MOD
STO 11
LBL 12
1
ST+ 15
RCL 16
RCL 15
X<=Y?
GTO 10
RCL 17
1
-
5
XEQ 21
RCL 11
XEQ 18
RCL 8
/
STO 13
LBL 09
3
STO 14
LBL 13
RCL 14
RCL 16
3
*
LN
RCL 14
LN
/
INT
STO 12
Y^X
STO 8
RCL 17
2
XEQ 20
STO 7
0
STO 11
STO 6
STO 18
1
STO 10
STO 15
CHS
STO 19
2
CHS
STO 21
3
CHS
STO 20
LBL 14
RCL 15
2
ST+ 18
*
STO 0
18
STO 5
1
CHS
STO 9
XEQ 15
RCL 0
RCL 7
*
RCL 8
MOD
STO 7
RCL 15
2
ST+ 19
*
1
ST+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