scripts: add onetest_gesamt for arm64
[testub10.git] / gesamt / codeb_georg_fib_044.0
1 /* fibonacci */
2
3 /* F_0 = 0 */
4 /* F_1 = 1 */
5 /* F_n = F_{n-1} + F_{n-2} */
6
7 struct a b c end;
8
9 method fib(x)
10         if x < 0 then return x; end;
11         a := 0;
12         if x < 1 then return x; end;
13         b := 1;
14         if x < 2 then return x; end;
15         var t := this;
16
17         while not (x < 2)
18         do
19                 t.c := t.a-(0-t.b);
20                 t := t--8;
21                 x := x-1;
22         end;
23         return (t-8).c;
24 end;