(j3.2006) Asymmetry of REAL, CMPLX
Van Snyder
Van.Snyder
Mon Jan 7 19:08:45 EST 2008
Assuming no KIND argument...
Where REAL has a real, integer or BOZ argument, its result kind is
default real.
Where REAL has a complex argument, its result kind is the same as the
argument.
Where CMPLX has a complex, integer or BOZ argument, its result kind is
default real.
Where CMPLX has a real argument, its result kind is still default real,
NOT the same as the argument. This is the one that's singled out for
unexpected behavior, and shouldn't be.
REAL <=> COMPLEX ought to work consistently, not REAL => COMPLEX working
one way, and COMPLEX => REAL working differently.
Dan has pointed out that there have been other proposals for a new
intrinsic, spelt COMPLEX e.g., that would provide symmetry. That's just
sugar for CMPLX with a KIND argument; it doesn't solve the real problem,
which is the surprising asymmetry that costs time, money and
reliability.
More information about the J3
mailing list