Skip to content

Latest commit

 

History

History

Q149157

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
layout title permalink
page
Q149157: BUG: Some Compiler and Debugger REAL Arithmetic Results Differ
/kb/149/Q149157/

Q149157: BUG: Some Compiler and Debugger REAL Arithmetic Results Differ

{% raw %}

Article: Q149157
Product(s): Microsoft Fortran Compiler
Version(s): 4.0
Operating System(s): 
Keyword(s): kbFortranPS kbLangFortrankbbuglist
Last Modified: 02-NOV-1999

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Fortran PowerStation for Windows 95 and Windows NT, version 4.0 
-------------------------------------------------------------------------------

SYMPTOMS
========

The results of some REAL double-precision arithmetic expressions generated by
the compiler are different in the low order decimal digits from what is
displayed for the same arithmetic expressions in the debugger.

CAUSE
=====

Intermediate values in the debugger are saved to and reloaded from the stack.
The saving and reloading of these intermediate values causes some rounding to
occur.

STATUS
======

Microsoft has confirmed this to be a bug in the Microsoft products listed at the
beginning of this article. We are researching this problem and will post new
information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION
================

Steps to Reproduce Problem
--------------------------

1. Build a project containing the following sample code:

2. 

  C Compile options needed: /Zi

        real*8  A, B, C, D

        A = 100.92
        B = -82.73
        C = -17.29
        D = 4.0

        write (*,*) (((-C)**D)+((A*D)/B))

        end

3. From the Developer Studio Build menu, choose Debug, and then select Step Into
  to begin the debugging process.

4. Step past the "write" statement.

5. In either the watch or quickwatch window, type the following arithmetic
  expression and press the ENTER key:

  " (((-C)**D)+((A*D)/B)) " (without the quotation marks)

6. View the debugger and program output.

Output
------

From the debugger: 89362.714366112600000

Program execution: 89362.714366112590000

Additional query words: 4.00

======================================================================
Keywords          : kbFortranPS kbLangFortran kbbuglist
Technology        : kbAudDeveloper kbPTProdChange kbFortranSearch kbFORTRANPower400NT
Version           : :4.0

=============================================================================

{% endraw %}