RE: [Dev-C++] Fibonacci numbers / unsigned long long int
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Mat...@Ve...> - 2005-03-07 15:08:54
|
Very impressive! Nice work! -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Per Westermark Sent: Sunday, March 06, 2005 11:00 PM To: Alfred P. Reaud Cc: Dev-Cpp UserList Subject: Re: [Dev-C++] Fibonacci numbers / unsigned long long int 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 > > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |