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 

If variable is NaN ...

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



Joined: 10 Mar 2008
Posts: 2957
Location: South Pole, Antarctica

PostPosted: Wed Dec 03, 2025 11:51 am    Post subject: If variable is NaN ... Reply with quote

I do not remember FTN95 had NaN before.

I got corruption on harddrive or SSD (being lazy to do the entire disk formatting with check - this takes way too long now, a week or so). As a results computer trying to recover the data had read them as NAN and denormals.

How best to write IF statement to exclude them from consideration in the code?

Code:
IF(variableA.eq.NaN) goto 1000

Code:
IF(variableB.eq.denormal) goto 1000
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 03, 2025 1:13 pm    Post subject: Reply with quote

Version 9.10 of FTN95 supports the intrinsic module IEEE_ARITHMETIC which means that Fortran 2003 intrinsics such as IEEE_IS_NAN are available when you "USE IEEE_ARITHMETIC".
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2957
Location: South Pole, Antarctica

PostPosted: Sat Dec 06, 2025 3:03 pm    Post subject: Reply with quote

Thanks, I briefly looked at that fortran 2003 NaN stuff and seems all is clear there. Also are denormal numbers treated there the same way ?

I remember FTN95 had some protective measures against denormals even way before F2003 and I used tricks against of them, if I am not mixing these with something they were like this below. I do not using them now for a long time.

Code:
        call mask_underflow@()
   call PERMIT_UNDERFLOW@(0_2)
   call PERMIT_UNDERFLOW@(.TRUE.)


If these are indeed related to the denormals can I still use them ?
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 -> General 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