/* fibonacci */ /* F_0 = 0 */ /* F_1 = 1 */ /* F_n = F_{n-1} + F_{n-2} */ method fib() if this < 2 then return this; end; var a := 0; var b := 1; var c := this; var x := this; while not (x < 2) do c := a-(0-b); a := b; b := c; x := x-1; end; return c; end;