The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



BlockExceptions


Unit: SDL_math2
Class: TMathExpression
Declaration: property BlockExceptions: boolean;

The processing of exceptions is inherently slow, which might cause problems when processing a high number of mathematical expressions each of which raising an exception (for example, division by zero). In this case you can turn off all arithmetic exceptions by setting the property BlockExceptions to TRUE. If the arithmetic exceptions are blocked, the Evaluate function returns a default value (defined by the property ErrorValue) instead of raising an exception.

The following arithmetic functions are affected by BlockExceptions:

  • arcsin, arccos if the argument is > 1
  • ndquant if the argument is < 0 or > 1
  • ln, lg if the argument is ≤ 0
  • sqrt if the argument is negative
  • / if division by zero
  • mod if the divisor is < 1
  • power if a non-integer power of a negative number is calculated

 

Hint: BlockExceptions only affects arithmetic exceptions, all other exceptions are not blocked.



Last Update: 2023-Feb-06