replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Arithmetic error trapping
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Arithmetic error trapping

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
KennyT



Joined: 02 Aug 2005
Posts: 318

PostPosted: Wed Apr 10, 2013 3:24 pm    Post subject: Arithmetic error trapping Reply with quote

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:

Code:
     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
Back to top
View user's profile Send private message Visit poster's website
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Wed Apr 10, 2013 5:01 pm    Post subject: Reply with quote

Interesting observation Smile

The Fortran Standard doesn't allow you use to different integer kinds for each argument of MOD.

I know FTN95 seems to work for some KIND combinations but I always saw this as an extension to the standard.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group