[Contents] [Previous Section] [Next Section] [Index]


1.4 Exception Conditions and Exception Behavior

DPML routines are designed to provide predictable and platform-consistent exception conditions and behavior. When an exception is triggered in a DPML routine, two pieces of information can be generated and made available to the calling program for exception handling:

The exception condition-handling mechanisms on your platform dictate how you can recover from an exception condition, and whether you can expect to receive an exception notification, a return value, or both, from a DPML routine.

The Exceptions section of each DPML routine documents each exceptional argument that results in an exception behavior. In addition to the exceptional arguments, an indication of how the DPML routines treat each argument is given. Exceptional arguments are sometimes presented in terms of symbolic constants.

For example, the following table lists the exceptional arguments of the exponential routine, exp(x):


Exceptional Argument         Exception Condition/Routine Behavior

x > ln(max_float)      		Overflow

x < ln(min_float)      		Underflow



The exceptional arguments indicate that whenever x > ln(max_float) or x < ln(min_float), DPML recognizes an overflow or underflow condition, respectively.

The symbolic constants ln(max_float) and ln(min_float) represent the natural log of the maximum and minimum representable values of the floating-point data type in question. The actual values of ln(max_float) and ln(min_float) are described in Appendix A.

DPML recognizes three predefined conditions: overflow, underflow, and invalid argument. Table 1-3 describes the default action and return value of each condition.

Table 1-3 Default Action and Return Values for Exception Conditions


Exception Condition        Default Action        Return Value

	Overflow         	Trap             HUGE_RESULT

	Underflow        	Continue         0
	                 	Quietly

	Invalid          	Trap             INV_RESULT
	argument



The values HUGE_RESULT and INV_RESULT are data-type dependent.

For IEEE data types, HUGE_RESULT and INV_RESULT are the floating- point encodings for Infinity and NaN respectively.

For VAX data types, HUGE_RESULT and INV_RESULT are max_float and 0 respectively.


[Contents] [Previous Section] [Next Section] [Index]