Skip to content
Prev 61878 / 63421 Next

Recent changes to as.complex(NA_real_)

On 2023-09-22 6:38 am, Martin Maechler wrote:
Thank you for the correction - indeed, as.complex(NA_real_) and
NA_real_ + (0+0i) are identical in both R-patched and R-devel,
both giving complex(r=NA_real_, i=0) in R-patched and both giving
NA_complex_ in R-devel.  I was hallucating, it seems ...
R_binary() in arithmetic.c has always coerced REALSXP->CPLXSXP when
encountering one of each.  Surely then the changes in coerce.c are the
cause and this arithmetic behaviour is just a (bad, IMO) side effect?
Thank you, Martin, for "reopening".

Mikael