Delphi / Object Pascal · Exception

Runtime Error 207: EInvalidOp (invalid floating point operation)

What does Runtime Error 207: EInvalidOp (invalid floating point operation) mean in Delphi / Object Pascal?

A floating-point operation had no valid mathematical result, such as taking the square root of a negative number.

Runtime Error 207: EInvalidOp (invalid floating point operation)Delphi (VCL) · Delphi (FireMonkey)

Condition

A floating-point operation had no valid mathematical result, such as taking the square root of a negative number.

Fix

Check the domain of the input before calling the function involved, particularly for values coming from a calculation or external data rather than a literal constant.

Pending source verification. Not yet checked against official documentation.

Related exception