Re: [Dev-C++] Fibonacci numbers / unsigned long long int
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2005-03-07 07:00:01
|
Nothing wrong with the long long int declaration. However, MinGW is using Microsoft libraries, and the Microsoft libraries doesn't understand the "%llu" formatting parameter. Instead, "%I64u" must be used to print 64-bit numbers. Since the x86 architecture stores lowest byte first, "%llu" becomes "%lu" and the least significant 4 bytes gets printed and the most significant 4 bytes are left on the stack for following printf parameter declarations to use... /Per W On Sun, 6 Mar 2005, Alfred P. Reaud wrote: > It appears you may be exceeding the length of a 32 bit int, which is what probably happened with the long long int declaration. Try declaring long long instead of long long int for Fibonacci. Interesting bug! > > Dion Bouwer <dio...@in...> wrote: > > <snip> > > unsigned long long int Fibonacci[numFibs]; > > <snip> > > > > > Alfred P. Reaud > > > |