FIX: Incorrect Results from Mixed-Type Expressions (85306)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 4.0
- Microsoft FORTRAN Compiler for MS-DOS 4.01
- Microsoft FORTRAN Compiler for MS-DOS 4.1
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 4.1
- Microsoft FORTRAN compiler for OS/2 5.0
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q85306 SYMPTOMS
A program compiled with Microsoft FORTRAN version 4.0, 4.01, 4.1, 5.0, or
5.1 under MS-DOS or version 4.1, 5.0, or 5.1 under OS/2 can generate
incorrect results on mixed-type expressions when an INTEGER variable is
used on both sides of an equation. The /Od compiler option, which is used
to suppress optimization, has no effect.
CAUSE
The compiler is incorrectly converting intermediate values to the INTEGER
type used on both sides of the arithmetic statement.
RESOLUTION
To avoid this problem, keep data types consistent within arithmetic
expressions by using the intrinsic functions to force the conversion of
intermediate expressions to the proper data type.
STATUS
Microsoft has confirmed this to be a problem in Microsoft FORTRAN versions
4.0, 4.01, 4.1, 5.0, and 5.1 for MS-DOS and versions 4.1, 5.0, and 5.1 for
OS/2. This problem was corrected in FORTRAN PowerStation.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbfix KB85306 |
---|
|