- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiler: ifx (IFX) 2026.0.0
OS: Ubuntu 22.04.05 LTS (Jammy Jellyfish)
The imaginary part of a complex(8) number cannot successfully be set to ieee_signaling_nan. When displayed, it correct shows "NaN", but when compared using ieee_class to ieee_signaling_nan, it comes up false. Please see the following example; it is also attached.
program main
use, intrinsic :: ieee_arithmetic
implicit none
complex(8) :: c8
c8 = cmplx(0d0, ieee_value(c8%im,ieee_signaling_nan))
print *, c8
print *, c8%im
print *, ieee_class(c8%im) == ieee_signaling_nan
print *, ieee_class(imag(c8)) == ieee_signaling_nan
end program
Note that the real part of the complex(8) can be set to ieee_signaling_nan, and the complex(4) case works for real, imaginary, and both.
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page