Post Reply 
Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
02-21-2017, 12:33 PM
Post: #48
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
to 'Kahan sum' an exploded list, you may use:
In: ob1..obN N
Out: Sum(ob1..obN)

Code:
\<<
  0 0 ROT
  1 SWAP START      @ xi s c
    ROT + DUP2 +    @ s y t
    ROT OVER -      @ y t s-t
    ROT +           @ s c
  NEXT
  DROP
\>>


Unfortunately, for 12-digit machines it makes no difference in RFC(25) and RFC(37) (summing small to large)

Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
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 - Werner - 02-21-2017 12:33 PM



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