This article was previously published under Q42473
This article has been archived. It is offered "as is" and will no longer be updated.
When the error "Overflow" is encountered in a Microsoft QuickBasicprogram, 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 and6.00b for MS-DOS and MS OS/2; and to Microsoft Basic PDS Version 7.00for MS-DOS and MS OS/2.
Any numeric value divided by zero will produce the error "Division ByZero," but zero (0) being divided by zero produces a special floating-point exception. This error will cause the compiler to respond with an"Overflow" message.
Both of these errors are correct. The machine could respond by eithera "Division By Zero" error or an "Overflow" error, depending on thefollowing factors:
Is the computer using a coprocessor?
Is the coprocessor functioning correctly?
What operating system are you using? (There was a problem with PC-DOS Version 3.20.)
When diagnosing an "Overflow" error, you may wish to first determineif the expression reduces to zero divided by zero. This might save youwork trying to figure out why your expression is overflowing (orexceeding some numerical limit).
The following is a code example:
b# = 5c# = 5PRINT (b#-c#) / (b#-c#) ' This will result in an "Overflow" error