Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,2 @@
: fib ( n -- fib )
0 1 rot 0 ?do over + swap loop drop ;

View file

@ -0,0 +1,5 @@
: fib ( n -- Fn ) 0 1 begin
rot dup 0 = if drop drop exit then
dup 0 > if 1 - rot rot dup rot +
else 1 + rot rot over - swap then
again ;

View file

@ -0,0 +1,17 @@
: F-start, here 1 0 dup , ;
: F-next, over + swap
dup 0> IF dup , true ELSE false THEN ;
: computed-table ( compile: 'start 'next / run: i -- x )
create
>r execute
BEGIN r@ execute not UNTIL rdrop
does>
swap cells + @ ;
' F-start, ' F-next, computed-table fibonacci 2drop
here swap - cell/ Constant #F/64 \ # of fibonacci numbers generated
16 fibonacci . 987 ok
#F/64 . 93 ok
92 fibonacci . 7540113804746346429 ok \ largest number generated.