Microsoft KB Archive/42473

= &quot;Overflow&quot; Error Might Be the Result of 0/0 =

Article ID: 42473

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q42473



SUMMARY
When the error &quot;Overflow&quot; is encountered in a Microsoft QuickBasic program, one possibility is to check for a zero divided by zero (0/0) condition.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS; to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2; and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.



MORE INFORMATION
Any numeric value divided by zero will produce the error &quot;Division By Zero,&quot; but zero (0) being divided by zero produces a special floating- point exception. This error will cause the compiler to respond with an &quot;Overflow&quot; message.

Both of these errors are correct. The machine could respond by either a &quot;Division By Zero&quot; error or an &quot;Overflow&quot; error, depending on the following factors:


 * 1) Is the computer using a coprocessor?
 * 2) Is the coprocessor functioning correctly?
 * 3) What operating system are you using? (There was a problem with PC-DOS Version 3.20.)

When diagnosing an &quot;Overflow&quot; error, you may wish to first determine if the expression reduces to zero divided by zero. This might save you work trying to figure out why your expression is overflowing (or exceeding some numerical limit).

The following is a code example: b# = 5 c# = 5 PRINT (b#-c#) / (b#-c#) ' This will result in an &quot;Overflow&quot; error

Additional query words: QuickBas BasicCom

Keywords: KB42473

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.