Finding the fibonacci number of large number
问题 I wrote the following program for finding the modulus of large Fibonacci's number. This can solve large numbers but fails to compute in cases like fibo_dynamic(509618737,460201239,229176339) where a = 509618737 , b = 460201239 and N = 229176339 . Please help me to make this work. long long fibo_dynamic(long long x,long long y,long long n, long long a[]){ if(a[n]!=-1){ return a[n]; }else{ if(n==0){ a[n]=x; return x; }else if(n==1){ a[n]=y; return y; }else { a[n]=fibo_dynamic(x,y,n-1,a)+fibo