7 lines
167 B
Text
7 lines
167 B
Text
#include "axiom"
|
|
Z ==> Integer;
|
|
fib(x:Z):Z == {
|
|
x <= 0 => error "argument outside of range";
|
|
f(n:Z,v1:Z,v2:Z):Z == if n<2 then v2 else f(n-1,v2,v1+v2);
|
|
f(x,1,1);
|
|
}
|