repo.or.cz
/
factor
/
jcg.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git]
/
extra
/
benchmark
/
fib2
/
fib2.factor
blob
043a98f394dfaab317ee95c6f9eab14d6558b98c
1
USING: math.private kernel debugger ;
2
IN: benchmark.fib2
3
4
: fixnum-fib ( m -- n )
5
dup 1 fixnum<= [
6
drop 1
7
] [
8
1 fixnum- dup fixnum-fib swap 1 fixnum- fixnum-fib fixnum+
9
] if ;
10
11
: fib-main ( -- ) 34 fixnum-fib 9227465 assert= ;
12
13
MAIN: fib-main