Search found 76 matches

by wook
Sat Oct 02, 2004 1:20 am
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 17450

Oh..

Did you except that integer would be overflow?

64bit integer cannot save Fibonacci(2147483647) ....

Then you can use (a * b + c) % d = ((a % d) * (b % d) + c % d) %d


So, try modular operating in "O(logN) Fibonacci" Code.

You can get correct answer without using "BigInteger".

Thank You. :D

Go to advanced search