CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Angry Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'float')

    I am running C code compiled and linked in two different configurations of the same 'project' with exactly the same settings (source/header files, include directories, libraries, additional dependencies, etc.). The two configurations are 'Debug' and 'float'; both are in floating point arithmetic, which is selected in preprocessing (a macro that selects fixed or floating point arithmetic is not defined, leading to compiling/linking in floating point). The numerical results differ between the two runs; e.g., an array element that is a complex-number structure (with two float members---real and imag) shows significantly different numeric values after the two runs.

    Has anybody come across a similar problem? I would appreciate any insight, or suggestions for where to look---thank you in advance.

  2. #2
    Join Date
    Apr 1999
    Posts
    50

    Re: Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'float')

    Hallo.

    Are there any differences in optimisation or preprocessor symbols?

  3. #3
    Join Date
    Aug 2007
    Posts
    3

    Re: Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'float')

    Hello, I was away from the site (lost password; had to see to other tasks), sorry for the silence...

    Preprocessor Definitions are "WIN32;_DEBUG;_CONSOLE" in 'Debug' and none in 'float'.

    Optimizations are disabled in 'Debug' and "Maximize Speed (/O2)" in 'float'.

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'flo

    Quote Originally Posted by D.Mihai
    Has anybody come across a similar problem? I would appreciate any insight, or suggestions for where to look---thank you in advance.
    Maybe it's a bug in your program.

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Aug 2007
    Posts
    3

    Re: Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'float')

    Thank you, I will look again into it.

    Regards,

    Mihai Ionescu

  6. #6
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Numerical discrepancy between 2 project configurations in fltpnt ('Debug' vs 'float')

    Quote Originally Posted by D.Mihai
    I am running C code compiled and linked in two different configurations of the same 'project' with exactly the same settings (source/header files, include directories, libraries, additional dependencies, etc.). The two configurations are 'Debug' and 'float'; both are in floating point arithmetic, which is selected in preprocessing (a macro that selects fixed or floating point arithmetic is not defined, leading to compiling/linking in floating point). The numerical results differ between the two runs; e.g., an array element that is a complex-number structure (with two float members---real and imag) shows significantly different numeric values after the two runs.

    Has anybody come across a similar problem? I would appreciate any insight, or suggestions for where to look---thank you in advance.
    I suggest reading this FAQ: http://www.codeguru.com/forum/showthread.php?t=323835.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured