replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Invalid Floating Point Number exception
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 

Invalid Floating Point Number exception

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



Joined: 13 Oct 2014
Posts: 1255
Location: Morrison, CO, USA

PostPosted: Mon Apr 07, 2025 10:16 pm    Post subject: Invalid Floating Point Number exception Reply with quote

I have a customer who told me that an "Invalid Floating Point Number" had been raised, and the error box disappeared and the program halted.

I am looking for either a way to flag where the error occurred, or to acknowledge the error by substituting a different value (valid, of course) and flagging the error and continuing.

Any insights would be helpful.

It is possible that a variable does not get initialized properly; without a location given, it will be impossible. The error does not appear to be repeatable; however, I will ask my user to re-run his data a few time, JIC.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 08, 2025 8:14 am    Post subject: Reply with quote

"Invalid Floating Point Number" is runtime error number 27 in the FTN95 library but I can't see any reference to it .
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1255
Location: Morrison, CO, USA

PostPosted: Tue Apr 08, 2025 10:59 pm    Post subject: Reply with quote

I put in the call to trap FP exceptions (Win32). This is a random occurrence so far as I can tell; likely my problem with some FP I don't properly initialize. Still...

It would be helpful to know how to force an invalid FP number (and other exceptions) to see if it now ignores the error, or still crashes.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 09, 2025 7:14 am    Post subject: Reply with quote

One possibility is to use the IEE_ARITHMETIC module and a call to

Code:
x = ieee_value(x,IEEE_QUIET_NAN)


Using x might give the desired result.

Otherwise the TRANSFER function can be used to to set an integer hexadecimal value and convert it to REAL.

For example, a 32 bit NAN has 255 in the exponent part and non-zero in the fractional part.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1255
Location: Morrison, CO, USA

PostPosted: Wed Apr 09, 2025 10:33 pm    Post subject: Reply with quote

Thanks, Paul. I'm going to experiment with this a bit!

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