Reference Guide
2-30 RPL Programming Examples
BER program listing
Program: Comments:
«
→ x
Creates local variable x.
«
Begins outer defining procedure.
'x/2' →NUM 2 1
→ xover2 j sum
Enters x/2, the first counter value, and
the first term of the series, then creates
local variables.
«
Begins inner defining procedure.
DO
Begins the loop.
sum
'sum+(-1)^(j/2)*
xover2^(2*j)/SQ(j!)'
EVAL
Recalls the old sum and calculates the
new sum.
2 'j' STO+
Increments the counter.
DUP 'sum' STO
Stores the new sum.
UNTIL
Ends the loop clause.
==
Tests the old and new sums.
END
Ends the loop.
sum
Recalls the sum.
»
Ends inner defining procedure.
»
Ends outer defining procedure.
»
`O
BER K
Stores the program in BER.
Checksum: # 15837d
Bytes: 203
Example:
Calculate BER(3).
J
3
%BER%
Calculate BER(2) in algebraic syntax.
O
%BER%
!Ü
2
N