"Bill" <Bi***********@SYColeman.com> wrote...
I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).
The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.
Any ideas?
The difference between release and debug versions of your program
is most likely due to the fact that MS compiler initialises all
variables to something meaningful in debug and leaves uninitialised
objects as is in release. So, check your code to see if you rely
on some variable being 0 upon creation. For example
double a;
leaves 'a' uninitialised. In debug mode MSVC++ will make it 0. In
release mode you get garbage in it. If you create some kind of
accumulator
double integral;
for (blahblah)
integral += some_formula();
then, since 'integral' has never been initialised to 0, you add to
some random value.
Of course, it could be something else...
Victor