KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q58124: BASIC 7.00/7.10: Incorrect Results with Alternate Math Library

Article: Q58124
Product(s): See article
Version(s): 7.00   | 7.00
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | buglist7.00 fixlist7.10 | mspl13_basic
Last Modified: 20-SEP-1990

Using Microsoft BASIC Professional Development System (PDS) version
7.00 for MS-DOS and MS OS/2, the code example below produces incorrect
results when compiled with the alternate math library (/FPa).

This code works correctly in the QBX.EXE environment or when compiled
with BC /D (debug) or /X. It also works correctly when compiled with
BC /FPa in Microsoft BASIC Compiler versions 6.00 and 6.00b for MS-DOS
and MS OS/2. Dimensioning the array as double-precision also works
around the problem.

Microsoft has confirmed this to be a problem in Microsoft BASIC PDS
version 7.00. This problem was corrected in BASIC PDS 7.10.

Code Example
------------

   DIM A(3)
   A(i%) = 5
   sx = A(i%)
   pr = .1 * A(i%)
   PRINT pr, sx, A(i%)

Compile as follows:

   BC prog /o /fpa;

Link as follows:

   LINK prog;

The correct output from BASIC 7.10 is as follows:

   .5     5     5

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.