Ad Space — Top Banner

?OV ERROR

Tandy / Radio Shack TRS-80

Severity: Minor

What Does This Error Mean?

?OV ERROR means a numeric calculation produced a result too large for BASIC to handle. TRS-80 BASIC can handle numbers up to approximately 1.7 x 10^38. Reduce the scale of your calculations or break them into smaller steps.

Affected Models

  • TRS-80 Model I
  • TRS-80 Model II
  • TRS-80 Model III
  • TRS-80 Model 4
  • TRS-80 Color Computer (CoCo)
  • MAME TRS-80 emulator
  • trs80gp emulator

Common Causes

  • Multiplication or exponentiation producing a number larger than 1.7E+38
  • Runaway loop that keeps adding or multiplying without bounds
  • Exponential growth in a calculation (compound interest, factorials, etc.)
  • Division by a very small number producing a very large result

How to Fix It

  1. Check which calculation is producing the overflow.

    Add PRINT statements before the failing line to see the values involved. Identify which variable is growing too large.

  2. Break large calculations into smaller steps.

    Instead of A = B * C * D * E (which might overflow mid-calculation), compute in stages: 10 X = B * C 20 Y = X * D 30 A = Y * E

  3. Use logarithms for very large numbers.

    If you need to work with numbers beyond the range, use LOG() to convert to logarithmic scale. Perform operations in log space, then convert back with EXP().

Frequently Asked Questions

What is the largest number TRS-80 BASIC can handle?

Approximately 1.70141183 x 10^38. This is the limit of single-precision floating-point numbers used by Microsoft BASIC. Numbers beyond this cause ?OV ERROR.

What is the smallest non-zero number?

Approximately 2.93874 x 10^-39. Numbers smaller than this are rounded to zero (underflow) rather than causing an error.