BUG: Illegal function call / Division By Zero Errors

Last reviewed: June 21, 1995
Article ID: Q94778
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0 - The Standard and Professional Editions of Microsoft Visual Basic
  for MS-DOS, version 1.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS,
  version 7.1

SYMPTOMS

Certain complex numeric expressions may incorrectly cause "Illegal function call" or "Division by zero" errors when run in the interpreter environment of the above mentioned Basic products. This problem only happens on computers that have a math coprocessor.

These errors, however, do not occur with programs compiled using the BC.EXE compiler included with Microsoft Basic Professional Development System for MS-DOS, version 7.1 and the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0

STATUS

Microsoft has confirmed this to be a bug with 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

To work around this problem, do one of the following:

  • Break the complex equation into smaller parts that are evaluated separately.
  • Turn off use of the coprocessor with SET NO87=x at the DOS prompt (PDS and Visual Basic for MS-DOS only).
  • Compile using the alternate math (/FPa) option (PDS and the Professional Version of Visual Basic for MS-DOS only).

The following code reproduces the "Illegal Function Call" error on a computer that has a coprocessor:

   test = 1 + (1 + 1 * (1 * (1 + 1 ^ 1)))

The following code reproduces the "Division by zero" error on a computer that has coprocessor:

   test = 1 + (1 - 1 * (1 + 1 / 1 ^ 1))

These are not the only expressions that cause the problem.


Additional reference words: buglist1.00 buglist2.00 buglist7.10 buglist3.00
1.00 2.00 3.00 7.10
KBCategory: kbenv kbbuglist
KBSubcategory: EnvtDes


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.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.