I'm passing this on for interest, because it doesn't happen in a 'pure' FTN95 application...
We provided DLLs to be called from a 3rd-party application, and got an 'arithmetic under/overflow error' condition when run under their app. Further investigation showed that the error occurs in the MOD function when mixed integer types are involved:
INTEGER*8 :: I8
INTEGER*4 :: I4,K4
K4 = MAX(1,K4)
I4 = I8
IF( MOD(I4,K4).EQ.0) THEN ! This works but...
IF( MOD(I8,K4).EQ.0) THEN ! This can cause an arithmetic error under 3rd party app
As I say, only passed on in case others hit the same issue, as it's not reproducible from an FTN95 EXE.
K