| View previous topic :: View next topic |
| Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2957 Location: South Pole, Antarctica
|
Posted: Wed Dec 03, 2025 11:51 am Post subject: If variable is NaN ... |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8305 Location: Salford, UK
|
Posted: Wed Dec 03, 2025 1:13 pm Post subject: |
|
|
| 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 |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2957 Location: South Pole, Antarctica
|
Posted: Sat Dec 06, 2025 3:03 pm Post subject: |
|
|
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 |
|
 |
|