-qxflag=dvz

Category

Error checking and debugging

@PROCESS

None.

Purpose

Causes the compiler to generate code to detect floating-point divide-by-zero operations.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -q--xflag-- = --dvz----------------------------------------><

Defaults

Not applicable.

Usage

This option takes effect at optimization levels of -O or higher.

With this option on, the extra code calls the external handler function __xl_dzx when the divisor is zero. The return value of this function is used as the result of the division. Users are required to provide the function to handle the divide-by-zero operations. Specifying -qxflag=dvz handles only single-precision (REAL*4) and double-precision (REAL*8) division.

The interface of the function is as follows:
 real(8) function __xl_dzx(x, y, kind_type)
   real(8), value :: x, y
   integer, value :: kind_type
 end function
where:
x
is the dividend value
y
is the divisor value
kind_type
specifies the size of the actual arguments associated with x and y.

A kind_type value equal to zero indicates that the actual arguments associated with x and y are of type REAL(8). A kind_type value equal to one indicates that the actual arguments associated with x and y are of type REAL(4).

The division always executes before the handler routine is called. This means that any exception is posted and handled before the handler function is called.

Related information