Author Topic: Problem with using CodeBlock 8.02  (Read 3133 times)

Dony

  • Guest
Problem with using CodeBlock 8.02
« 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]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Problem with using CodeBlock 8.02
« Reply #1 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
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Dony

  • Guest
Re: Problem with using CodeBlock 8.02
« Reply #2 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with using CodeBlock 8.02
« Reply #3 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.