Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Dony on April 05, 2008, 12:49:04 pm

Title: Problem with using CodeBlock 8.02
Post by: Dony on April 05, 2008, 12:49:04 pm
I have just download codeblocks-8.02mingw-setup.exe for Windows 2000 / XP / Vista
I have istalled it on windows XP sp2(AMD Athlon(tm)XP) and Windows Vista (Intel Core2 Centrino Duo), and I have compile and execute the same project.
Than I have compile the same project with Dev-C++ version 4 (Mingw compiler 2.95.2-1) [on SO WindowsXP] and with Pelle C for Windows  version 4.50.113 and I have a differen results (correct results).
I post the file .c in this forum. Could someone halp me please???



[attachment deleted by admin]
Title: Re: Problem with using CodeBlock 8.02
Post by: MortenMacFly on April 05, 2008, 12:52:13 pm
and I have a differen results (correct results).
Huh? I have no idea what that shall mean. Mind explaining a little more in detail? What do you mean with different results? The one file is red, the other green or what?! :P
Title: Re: Problem with using CodeBlock 8.02
Post by: Dony on April 05, 2008, 01:28:09 pm
ok...
if you read the code, you see that I have used a long double for computation (there are 4) and when I print its 2 of 4 are an overfloat results... but they must be more or less the same...
if I compile and execute the program with "Pelles C for windows" it run and print 4 result that are almost the same

Moreover if I use a doulbe compiling and executing the program I have the same resutls with code blocks , dev-c++ and pelles C
Title: Re: Problem with using CodeBlock 8.02
Post by: Jenna on April 05, 2008, 02:59:47 pm
If you compile you get two warnings, because the single "f" in "printf" wants a double, but in two cases you've got a "long double".
So you get an overflow.
You should take "Lf" instead of "f" in this cases.

A warning always shows that something unexpected might happen, even if the code compiles without errors.