Unit
Math387
Math387 has an alternative implementation of the Trunc function that overrides the default System.Trunc function. Exception flags are set by the FPU when the result of a floating point operation is NAN or INF. If the exceptions are not enabled nothing happens, but the exception flags remain set. If you then enable FPU exceptions without first clearing the exception flags, an exception will be raised. Because those exceptions do not come from the current code (where the debugger stops), they make the debugging process much more difficult. A typical error indicating this problem is a Delphi message about a " Invalid floating point operation". With introduction of Delphi 6, this problem has been greatly reduced. When using third party code this problem might resurface, if the code requires floating exceptions to be turned on. In such cases you should call ClearFPU before enabling floating exceptions and disable them again when returning back to MtxVec code. Floating point exceptions must be turned off for MtxVec, or some optimization algorithms will not be able to converge.
| Copyright 2008 Dew Research |