From: SF/projects/mingw n. l. <min...@li...> - 2012-04-12 13:05:02
|
Bugs item #3517140, was opened at 2012-04-12 02:41 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3517140&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Gaetano (executive2002) >Assigned to: Cesar Strauss (cstrauss) Summary: wrong double representation Initial Comment: Hi, I am experiencing problems in a C++ program due to wrong representation on a double variabile. I'm using: Windows 7 Enterprise 64 bit gcc -v C:\Users\Gaetano>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable- sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-lib stdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC) As IDE, I use Eclipse for C/C++. Definition: float TagliMonete[] = {2.0, 1.0, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01 }; From TagliMonete[0]-TagliMonete[2] everything (in memory) is ok. TagliMonete[3] is represented in memory as 0.2000000003 TagliMonete[4] is represented in memory as 0.1000000001 TagliMonete[5] is represented in memory as 0.05000000007 TagliMonete[6] is represented in memory as 0.01999999996 TagliMonete[7] is represented in memory as 0.00999999978 I've seen these values in Debug mode. This is a very big problem due to problem on contabilization. How can I supersede the problem? Thanks a lot. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2012-04-12 06:05 Message: Please attach a small code working model that represents the problem with steps to recreate the problem using that working model. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3517140&group_id=2435 |