c----------------------------------------------------------- c Illustrates IEEE "exceptional" floating point "values" c c By default, floating point exceptions (underflow, c overflow, divide by 0, inexact result) are ignored c in program execution. On the SGIs, this behaviour c can be changed so that all FPE's are "trapped" and c result in termination of program execution by c c (1) Linking with the 'fpe' library c c % $(F77_LOAD) tfpe.o -lp329f -lfpe -o tfpe c c (2) Setting the environment variable 'TRAP_FPE' c prior to program execution c c % setenv TRAP_FPE "ALL=ABORT" c c See 'man handle_sigfpes' (FORTRAN pages) for more c detailed information. c----------------------------------------------------------- program tfpe implicit none real*8 r8arg real*8 divby0, overflow, notnumber divby0 = 1.0d0 / r8arg(1,0.0d0) write(0,*) 'divby0 = ', divby0 overflow = exp(1.0d10) write(0,*) 'overflow = ', overflow notnumber = sqrt(-1.0d0) write(0,*) 'notnumber = ', notnumber stop end