Skip to content
Back to formatted view

Raw Message

Message-ID: <16988.54652.912289.971238@stat.math.ethz.ch>
Date: 2005-04-13T08:17:00Z
From: Martin Maechler
Subject: Inf +1i vs 1+Inf*1i
In-Reply-To: <b1ff7cdbcfb15de44fe3e997c3718370@soc.soton.ac.uk>

>>>>> "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