NDPERR Function
Lahey/Fujitsu Fortran

NDPERR Function

Description

The NDPERR function detects exceptions raised by the numeric data processor.


Syntax

NDPERR (lvar)

Arguments

lvar is an INTENT(IN) scalar of type LOGICAL.

If lvar is true, NDPERR clears floating-point exception bits.

If lvar is false, NDPERR does not clear floating-point exception bits.

Result

The result is of type default INTEGER. Its value is the INTEGER value of the combination of the following bits, where a bit set to one indicates an exception has occurred:

 

NDPERR bits

Bit

Exception

0

Invalid Operation

1

Denormalized Number

2

Divide by Zero

3

Overflow

4

Underflow

Example

write(*,*) 0./0. ! writes -NaN write(*,*) ndperr(.true.) ! writes 1 write(*,*) tiny(1.e0)/100000. ! writes 1.1770907e-43 write(*,*) ndperr(.true.) ! writes 2