replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Underfflow within DLL
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 

Underfflow within DLL

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



Joined: 18 Feb 2005
Posts: 56
Location: Gummersbach, Germany

PostPosted: Tue Dec 13, 2011 7:55 am    Post subject: Underfflow within DLL Reply with quote

I can use one of my program in 2 different modes: Executable or dll.

Last week I found that execution is different depending on the mode. While the executable could finish without problems, the dll version triggered a run tim error. Reason for the run time error was an underflow condition for a floating point operation.

Example:
Double Precision :: x, y
x = 1.0d-180
y = x * x ! creates underflow

In both modes the same object file, created with FTN95 without option /UNDERFLOW, is used and linked either to the executable or to the dll.

It took two days of testing until finding the reason, as the error diagnostic for the dll was not specific and did not tell the reason and/or location.

Meanwhile I inserted a call to the routine
MASK_UNDERFLOW@
as a 1st executable statement into the code for the dll-version. Now the run time error disappears.

Questions:
1) Is there a certain reason for different exception handling?
2) Is the call to MASK_UNDERFLOW@ the preferable method to avoid run time errors when calling routines from a dll?
3) Can multiple calls to MASK_UNDERFLOW@ cause problems, in the case that the dll-function is used several time?
_________________
Thomas
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Dec 13, 2011 6:56 pm    Post subject: Reply with quote

Are you accessing the DLL from an FTN95 executable or from somewhere else?
Back to top
View user's profile Send private message AIM Address
Thomas



Joined: 18 Feb 2005
Posts: 56
Location: Gummersbach, Germany

PostPosted: Wed Dec 14, 2011 7:13 am    Post subject: Reply with quote

Hi Paul,
The DLL is used with VBA in an MS Excel environment.
Are You interested in an code example?
_________________
Thomas
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Dec 14, 2011 8:51 am    Post subject: Reply with quote

No, I don't need to see a code sample in this case thanks.
My guess is that the default underflow mask is being set in the primary (Excel) environment. Presumably it would work OK if you called the DLL from an FTN95 executable.
Back to top
View user's profile Send private message AIM Address
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