Hi If I have a <- Inf + 1i then Re(a) is Inf, and Im(a) is 1, as expected. But if b <- 1 + Inf * 1i, then Im(b) = Inf , as expected, but Re(b) = NaN, which I didn't expect. Why this asymmetry? How to define an object with Re(b)=1, Im(b)=Inf? -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
Robin, You could try b <- complex(real=1, im=Inf) ------------------------------------------ ?scar Manuel Rueda Palacio Viceintervenci?n Consejer?a de Hacienda Junta de Castilla y Le?n Tfno: 983414092 e-mail: ruepalos at jcyl.es ------------------------------------------ -----Mensaje original----- De: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]En nombre de Robin Hankin Enviado el: mi?rcoles, 13 de abril de 2005 9:51 Para: R-help at stat.math.ethz.ch Asunto: [R] Inf +1i vs 1+Inf*1i Hi If I have a <- Inf + 1i then Re(a) is Inf, and Im(a) is 1, as expected. But if b <- 1 + Inf * 1i, then Im(b) = Inf , as expected, but Re(b) = NaN, which I didn't expect. Why this asymmetry? How to define an object with Re(b)=1, Im(b)=Inf? -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 ______________________________________________ R-help at stat.math.ethz.ch mailing list stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! R-project.org/posting-guide.html
>>>>> "Robin" == Robin Hankin <r.hankin at soc.soton.ac.uk> >>>>> on Wed, 13 Apr 2005 08:51:19 +0100 writes:Robin> Hi Robin> If I have Robin> a <- Inf + 1i Robin> then Robin> Re(a) is Inf, and Im(a) is 1, as expected. Robin> But if Robin> b <- 1 + Inf * 1i, Robin> then Robin> Im(b) = Inf , as expected, but Re(b) = NaN, which I didn't expect. Robin> Why this asymmetry? I think this is a (very long standing) buglet in our complex arithmetic, since you can directly see > 1+ 1i*Inf [1] NaN+Infi Robin> How to define an object with Re(b)=1, Im(b)=Inf? {Oscar already mentioned b <- complex(real=1, im=Inf) } Martin Maechler, ETH Zurich