From ripley at stats.ox.ac.uk  Thu Sep 21 15:11:35 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 21 Sep 2006 14:11:35 +0100 (BST)
Subject: [Rd] printing of complex numbers in R-alpha
In-Reply-To: <17682.35463.124617.653585@stat.math.ethz.ch>
References: <0BAEBFBF-7FBC-4349-BDCE-30BAE955E11B@soc.soton.ac.uk>
	<17682.35463.124617.653585@stat.math.ethz.ch>
Message-ID: <Pine.LNX.4.64.0609211409540.29357@gannet.stats.ox.ac.uk>

On Thu, 21 Sep 2006, Martin Maechler wrote:

>>>>>> "Robin" == Robin Hankin <r.hankin at noc.soton.ac.uk>
>>>>>>     on Thu, 21 Sep 2006 08:05:24 +0100 writes:
>
>    Robin> Hello everyone
>    Robin> I am finding complex numbers to be printed oddly in R-alpha.
>
>
>    >> 1e100+1e100i
>    Robin> [1] 1e+100+1e+100i
>    >> 1e100 + 1e44i
>    Robin> [1] 1e+100+100000000000000008821361405306422640701865984i
>    >> dput(1e100+1e44i)
>    Robin> 1e+100+100000000000000008821361405306422640701865984i
>    >>
>
> ouch, ouch!
>
>    Robin> [same thing at home on a linux box]
>
>
>    Robin> The first line is what I would expect, the second and third lines
>    Robin> aren't:
>    Robin> I would prefer "1e100+1e44i".  Is this possible for  R-2.4.0?
>
> It should.

I think the right answer is 1e100+0i: read what 'digits' means for complex 
numbers.

It's been there since 2.2.0.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




[Rd] printing of complex numbers in R-alpha
Prof Brian Ripley