Skip to main content

ErMathError

ErMathError = 16

Example

function IsMappedMathFailure(const ErrorType: TIFException): Boolean;
begin
Result := ErrorType = ErMathError;
end;

Usage

ErMathError represents a caught Velox floating-point math exception other than division by zero.

Formatting and exception state

ExceptionToString ignores Param and returns Math error. An explicit RaiseException(ErMathError, ...) has the same category but does not construct or retain a Velox EMathError object.

Additional Technical Info

ErMathError is member ordinal 16 of TIFException, the script-visible declaration that is kept in exact ordinal alignment with PascalScript's runtime TPSError. Its sidebar position 29 is alphabetical navigation metadata and is not its enumeration value.

ErMathError is produced when PascalScript catches a Delphi EMathError after first excluding EZeroDivide. Overflow, underflow, invalid floating operations and other subclasses that reach these guarded runtime paths therefore collapse to one VM category. The caught native message is stored in ExceptionParam, and the native exception object may be retained for host-side re-raise. Script code receives only this category; it cannot determine the exact Delphi subclass from the constant.

Behavior, recovery and quirks

  • Floating-point control-word/masking settings and the operation determine whether Velox raises an exception, returns an IEEE special value or follows another path. This category documents mapping after a caught EMathError.
  • Validate predictable domains before calling math functions when local recovery is possible.
  • The fixed formatter hides the saved Velox message; inspect ExceptionParam and the failing operation for diagnosis.
  • Exception transfer is not a database, dataset, filesystem or external-system transaction. Any earlier side effect remains unless the called API or surrounding Flow provides an explicit rollback contract.
  • Do not persist the numeric ordinal as an integration contract. Store the member name, formatted message, parameter and relevant procedure/position with the Velox version.

Related Code Library entries

External references

Created 2026-07-15