Post Reply 
(50g) Nth Fibonacci Number
02-22-2015, 09:48 AM
Post: #2
RE: (50g) Nth Fibonacci Number
Another way to do it for integer input:

::
CK1&Dispatch
# FF
::
::
DUP
Z2_
Z<
case
::
BINT4
NDUPN
DROP
;
FPTR2 ^Z>ZH
Z-2_
Z0Z1_
4PICK
FPTR2 ^ZBits
SWAPDROP#1-_
ZERO_DO
FPTR2 ^ZSQ_
SWAP
FPTR2 ^ZSQ_
2DUP
FPTR2 ^RSUBext
DUP
FPTR2 ^RADDext
3PICK
FPTR2 ^RADDext
3UNROLL
FPTR2 ^RADDext
SWAPROT
FPTR2 ^RADDext
3PICK
ISTOP-INDEX
#1-
FPTR2 ^ZBit?
SWAPDROP
ITE
::
DUPUNROT
FPTR2 ^QAdd
Z-2_
;
Z2_
3UNROLL
LOOP
;
4UNROLL3DROP
;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (50g) Nth Fibonacci Number - Gerald H - 02-22-2015 09:48 AM
RE: (50g) Nth Fibonacci Number - Joe Horn - 02-22-2015, 09:06 PM
RE: (50g) Nth Fibonacci Number - Offroad - 02-23-2015, 03:07 AM
RE: (50g) Nth Fibonacci Number - rprosperi - 02-26-2015, 01:42 PM
RE: (50g) Nth Fibonacci Number - Han - 02-26-2015, 07:39 PM
RE: (50g) Nth Fibonacci Number - rprosperi - 02-26-2015, 08:23 PM
RE: (50g) Nth Fibonacci Number - Joe Horn - 02-26-2015, 10:19 PM
RE: (50g) Nth Fibonacci Number - Han - 02-27-2015, 03:29 AM
RE: (50g) Nth Fibonacci Number - rprosperi - 02-27-2015, 01:31 PM
RE: (50g) Nth Fibonacci Number - rprosperi - 02-27-2015, 01:43 PM
RE: (50g) Nth Fibonacci Number - rprosperi - 02-27-2015, 01:48 PM
RE: (50g) Nth Fibonacci Number - Han - 02-27-2015, 02:22 PM
RE: (50g) Nth Fibonacci Number - Gerald H - 02-27-2015, 03:27 PM



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