Hi,

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).

However when I write (_builtin_nan("") * 1.0i) I get (nan + nan I).  For
(__builtin_inf() * 1.0i) I get (nan + inf I).

I don't think these results are a bug, rather it's just an artifact of the
way complex multiplcation is done and having these special values in
there.  I had a similar problem getting negative zeros in the imaginary
part, but I solved that using conj(0.0) and conj(-0.0).  I don't think
conj helps for inf/nan though.

I know I can simply use a complex variable and set the real/imag parts
separately, but I want a constant expression which I can pass as an
argument to a builtin complex math function for writing testcases that
fold (or not) and compile-time.

Is there a way to get an imaginary inf or nan expression without having
the real part get changed?

                Thanks,
                --Kaveh
--
Kaveh R. Ghazi                  gh...@caip.rutgers.edu

Reply via email to