Delphi / Object Pascal · Exception

EOverflow Exception (Floating-Point)

What does EOverflow Exception (Floating-Point) mean in Delphi / Object Pascal?

Raised when a floating-point calculation produces a result larger than the target type can represent - for example an Extended calculation whose magnitude exceeds the type's maximum exponent range during an intermediate step.

EOverflow Exception (Floating-Point)Delphi (VCL) · Delphi (FireMonkey)

Condition

Raised when a floating-point calculation produces a result larger than the target type can represent - for example an Extended calculation whose magnitude exceeds the type's maximum exponent range during an intermediate step.

Fix

Rescale the calculation to avoid huge intermediate magnitudes, working in log space for products of many large numbers, or switch to a wider or more appropriate numeric type; also check for an accumulation bug that lets a loop-driven value grow unbounded.

Related exception