Commit 619ee7c
committed
Use x /= x test for NaN detection (ieee_is_nan failing)
CI evidence shows ieee_is_nan() is NOT detecting NaN values:
- No diagnostic messages appeared in output
- NaN still present at node 1303
- This indicates compiler optimization breaking ieee_is_nan
Root cause: Compiler flag -ffast-math or similar breaks IEEE 754 compliance,
making ieee_is_nan() unreliable.
Solution: Use mathematical property of NaN
- NaN is the ONLY value where (x /= x) returns TRUE
- This works even with aggressive compiler optimizations
- Combined with ieee_is_nan as belt-and-suspenders approach
Detection now uses:
if (ieee_is_nan(x) .or. x /= x) then
x = 0.0
end if
This should catch NaN regardless of compiler flags.1 parent e2635e4 commit 619ee7c
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
558 | 563 | | |
559 | 564 | | |
560 | 565 | | |
| |||
0 commit comments