What is a floating point overflow?

  • Scroll to top of this topic Scroll to Top of Page

  • Print the current topic Print Topic

  • No expanding elements on this page Show/Hide Expanders

Computers can represent real numbers in a number of different ways. The two most common are single-precision and double-precision. A single-precision variable uses 32 bits to represent a real number. The maximum single-precision number is approximately 3.4 x 1038. A double-precision variable uses 64 bits to represent a real number. The maximum double-precision number is approximately 1.8 x 10308. Thus a double-precision variable can hold much larger numbers than a single-precision variable. This can cause problems when assigning the value of a double-precision variable to a single-precision variable if the value of the double-precision variable is larger than the maximum possible single-precision variable. When a program attempts to do that a floating point overflow occurs. In general, a floating point overflow occurs whenever the value being assigned to a variable is larger than the maximum possible value for that variable.

Floating point overflows in MODFLOW can be a symptom of a problem with the model. For example, if a steady-state model has flow entering the groundwater but no place for flow to leave the system, the calculated head might eventually rise high enough to cause a floating point overflow.