The information in this article applies to:
SYMPTOMSWhen an application developed in Microsoft FORTRAN PowerStation runs on a computer that does not have a math coprocessor installed, the code may convert a REAL variable or expression to an INTEGER variable incorrectly, resulting in incorrect results. CAUSEWhen an application immediately converts the results of a REAL calculation to an INTEGER value, the code does not remove the results from the coprocessor emulator stack. The numeric conversion routine __ftol (float to long) uses this extended coprocessor-stack-based value instead of the truncated contents stored in the variable. The __ftol function incorrectly rounds down the extended-precision result. RESOLUTION
To work around this problem, use the NINT (round to nearest integer)
intrinsic function to explicitly convert the expression or variable to
an INTEGER.
STATUS
Microsoft has confirmed this to be a problem in PowerStation versions
1.0 and 1.0a for MS-DOS. This problem has been resolved with FORTRAN
PowerStation maintenance release version 1.0a for MS-DOS.
MORE INFORMATION
The FORTRAN PowerStation floating-point emulator is a virtual dynamic-
link library (DLL) in the Phar Lap MS-DOS extender. To duplicate this
problem on a computer with a math coprocessor installed, type the
following at the MS-DOS command prompt:
SET TNT=-FPEM This statement causes the MS-DOS extender to ignore the math coprocessor and use the emulator code for all math operations. The following code example prints the word "Failed" when it runs with the floating-point emulator: Sample Code 1C Compiler options needed: none
The following code example demonstrates using the NINT intrinsic function to avoid this error. This code prints the word "OK" even when a math coprocessor is not available. Sample Code 2C Compiler options needed: none
Additional query words: 1.00 Phar Lap DOSXMSF.EXE
Keywords : |
Last Reviewed: March 5, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |