Calculating Fibonacci Number accurately in C++?
I am really confused. I am trying to calculate Fibonacci numbers, but as they get larger and large the numbers start to become wrong. and I do not know why. How do you calculate accurate Fibonacci numbers using Binet's Formula, it is my understanding that this should always return a integer? Here is what I have been trying to work with. http://ideone.com/e6t6h See as the number goes up. it gets all weird? here I print it out with a cout.precision(15); http://ideone.com/XREh2 here I print it out with cout << fixed << blah blah; Here I have used a procedural loop to calculate it by going though