Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Catch Overflow but do not exit rom program

shinobi1986
Beginner
601 Views
I hope my english is good.. I need to catch an overlow but do not exit by my program.. The code is the following:

Program Fattoriale
USE MSFLIB

INTERFACE
FUNCTION hand_fpe (sigid, except)
INTEGER(4) hand_fpe
INTEGER(2) sigid, except
END FUNCTION
END INTERFACE
integer(4) iret

iret = SIGNALQQ(SIG$FPE, hand_fpe)

call singolaPrecisione

End


! Exception handler routine hand_fpe
FUNCTION hand_fpe (signum, excnum)

USE MSFLIB
INTEGER(2) signum, excnum

SELECT CASE(excnum)

CASE( FPE$OVERFLOW )
call doppiaPrecisione

!stop ' Fattoriale calcolato'

END SELECT
!hand_fpe = 1
END


Effectively i catch the overlow but on the screen appear "press any key to continue", then the program terminate... but i need to execute the code written in subroutine "doppiaPrecisione". How can i do?

Thanx for any help
0 Kudos
0 Replies
Reply