UNDFL Subroutine
LF Fortran 95

UNDFL Subroutine


The UNDFL subroutine masks and detects floating-point underflow exceptions.


UNDFL (lflag)


lflag is an INTENT(IN) scalar of type LOGICAL. It is assigned the value true if an underflow exception has occurred, and false otherwise.


lflag must be set to true on the first invocation.

The initial invocation of the UNDFL subroutine masks the underflow interrupt on the floating-point unit.

Subsequent invocation returns an lflag value of true if the exception has occurred or false if the exception has not occurred.


real(kind(1.d0)) :: a=tiny(a) logical :: lflag = .true. call undfl(lflag) ! mask the underflow interrupt write(*,*) lflag ! writes F do a=a/2.d0 call undfl(lflag)! test for underflow if(lflag) exit end do write(*,*) lflag ! writes T