scripts: add onetest_gesamt for arm64
[testub10.git] / gesamt / codeb_georg_fib_041.0
1 /* fibonacci */
2
3 /* F_0 = 0 */
4 /* F_1 = 1 */
5 /* F_n = F_{n-1} + F_{n-2} */
6
7 struct f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 end;
8
9 method fib(x)
10         if x < 0 then return -1; end;   f0 :=  0;
11         if x < 1 then return f0; end;   f1 :=  1;
12         if x < 2 then return f1; end;   f2 :=  1;
13         if x < 3 then return f2; end;   f3 :=  2;
14         if x < 4 then return f3; end;   f4 :=  3;
15         if x < 5 then return f4; end;   f5 :=  5;
16         if x < 6 then return f5; end;   f6 :=  8;
17         if x < 7 then return f6; end;   f7 := 13;
18         if x < 8 then return f7; end;   f8 := 21;
19         if x < 9 then return f8; end;   f9 := 34;
20         return f9;
21 end;