Creating imaginary inf/nan in GCC

Tobias Burnus burnus@net-b.de
Thu Jan 29 17:39:00 GMT 2009


Hi Kaveh,

Kaveh R. GHAZI wrote:
> I'm trying to create complex number expressions that contain inf or
> nan in the imaginary part.  I.e. (0 + inf I) or (0 + nan I).

If it does not need to be C (e.g. to try MPC in the middle end), you
could use Fortran:

! compile with gfortran -fno-range-check
complex :: z
z = cmplx(0.0, 0.0/0.0)
print *, z
end

Tobias



More information about the Gcc mailing list