xref: /illumos-gate/usr/src/common/ficl/test/fib.fr (revision afc2ba1d)
1*afc2ba1dSToomas Soome: fib ( n1 -- n2 )
2*afc2ba1dSToomas Soome    dup 1 > if
3*afc2ba1dSToomas Soome	dup
4*afc2ba1dSToomas Soome	1- recurse
5*afc2ba1dSToomas Soome	swap 2 - recurse
6*afc2ba1dSToomas Soome	+
7*afc2ba1dSToomas Soome    then ;
8*afc2ba1dSToomas Soome
9*afc2ba1dSToomas Soome
10*afc2ba1dSToomas Soome35 value nfibs
11*afc2ba1dSToomas Soome: fibtest nfibs fib . cr ;
12