X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=gesamt_ppc%2Fcodeb_georg_fib_022.0;fp=gesamt_ppc%2Fcodeb_georg_fib_022.0;h=b2ea26c89def65dc3d802e5c3a92169d5d350e75;hb=4efb64bb228c31bf3d1701e0f0ec28f2c05ed451;hp=0000000000000000000000000000000000000000;hpb=70aa500ad5f5643fa386027158bf774a8195f604;p=testub10.git diff --git a/gesamt_ppc/codeb_georg_fib_022.0 b/gesamt_ppc/codeb_georg_fib_022.0 new file mode 100644 index 0000000..b2ea26c --- /dev/null +++ b/gesamt_ppc/codeb_georg_fib_022.0 @@ -0,0 +1,19 @@ +/* fibonacci */ + +/* F_0 = 0 */ +/* F_1 = 1 */ +/* F_n = F_{n-1} + F_{n-2} */ + +method fib(x) + var a := 0; + var b := 1; + var c := x; + while not (x < 2) + do + c := a-(0-b); + a := b; + b := c; + x := x-1; + end; + return c; +end;