Post Reply 
Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
02-17-2017, 11:16 AM
Post: #8
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
(02-17-2017 08:03 AM)Werner Wrote:  How can the 42S code be 28 bytes, 41-compatible, yet the 41CV code is 33 bytes?

I have 27 bytes (excluding END, but including the three-letter label) on the 42 and 25 on the 41, stack-only. Of course.

Code:
>LBL "RFB"
 0
 STO ST Z
 1
>LBL 02
 1/X
 STO+ ST T
 X<> ST L
 STO+ ST Y
 X<>Y
 DSE ST Z
 GTO 02
 R^
 END

Günter

Cheers, Werner

Why excluding "END"? My program for the 42S is pretty close to yours. Also 27 bytes, including "END" and stack only, of course Smile

Code:
01 LBL "RFC"
02 0
03 0
04 1
05 LBL 00
06 1/x
07 STO+ ST Z
08 1/X
09 STO+ ST Y
10 x<>Y
11 DSE ST T
12 GTO 00
13 RCL ST Z
14 END

Günter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant - Guenter Schink - 02-17-2017 11:16 AM



User(s) browsing this thread: 2 Guest(s)