[Dev-C++] Numerical Difference betewen Dev-Cpp and Microsoft C++.NET
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luís B. <lf...@ya...> - 2003-01-09 02:55:12
|
Hi there
Ive just finished developing an mathematical
optimization program
in C++ for my Thesis. My base compiler that was
installed in my university was Microsoft Visual
C++.Net. Now Im trying to compile with Dev-Cpp in my
computer at home . The results were the same, until
my example 23, failed to converge in Dev-Cpp. When
dealing with math every decimal counts. And this is
the problem. The results are the following:
----------------------------------
Iteration function
error
next step
--------NET-----------------------------DEV----------
0 6.08269457903887380000 6.08269457903887380000
14.38658488183035000000 14.38658488183034500000
1.00000000000000000000 1.00000000000000000000
1 6.08269457903887380000 6.08269457903887380000
14.38658488183035000000 14.38658488183034500000
0.15334071686133940000 0.15334071686133718000
2 5.64283384487765800000 5.64283384487766430000
11.71651970320963600000 11.71651970320965800000
0.23998975404550715000 0.23998975404523476000
3 5.29623368056405490000 5.29623368056461440000
9.25439173550483750000 9.25439173550664760000
0.13589203600495686000 Error.
As you can in iteration 3 the program fails. I know
that is difficult to find the problem just by looking
at numbers!! The difference is always in the last
decimal places (>12).
I use templates in all classs and its being
initialize with double. My compilation options are
default. My computer is a Pentium 3. I think its
probably the double that has different
decimal places? Ive changed to (long double) but the
function pow in math doesnt accept anything
different from double. Even converting to double
the results are the same.
Thanks in advance for any help.
P.S. Sorry for my bad English
=====
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Luís Filipe Delgado Brás
lf...@ya...
http://www.fotopt.net/autor.asp?autor=2637
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
|