can someone explain to me how this program calculates nth fibonacci number? I scribbled for 2 hours now and stuck
hints greatly appreciated.
Thanks.Code:int f (unsigned int n) { int x = 0, y = 1, a = 1, b = 0, t; for (;;) { if (n & 1) { t = a; a = a * x + b * y; b = t * y + b * (x + y); } n >>= 1; if (n == 0) return b; t = x; x = x * x + y * y; y = t * y + y * (t + y); } }