Handling floating-point exceptions

An aspect of the execution environment beyond the settings of modes and flags is the dynamic handling of exceptions. As with the environment values, the IEEE standards provide an optional model of trap handling tied closely to what is expected to be the underlying hardware. This model has not gained acceptance because it is too platform-dependent and too dependent on trap-time context that may be compromised by code movement and other compiler optimizations. The CommonPoint solution is to support numerical exception handling with the general C++ mechanisms used throughout the system.

C++ defines a try block, from which exceptions can be thrown, to be caught by the corresponding catch block. The CommonPoint system defines C++ floating-point exception classes corresponding to the five floating-point exception flags. The class TFPExceptionHandler detects IEEE exception flags and throws the corresponding TFPException objects.

NOTE The class TFPExceptionHandler is the link between numerical exception flags and exception objects.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker