From pburns at pburns.seanet.com  Thu Mar 25 10:01:26 2010
From: pburns at pburns.seanet.com (Patrick Burns)
Date: Thu, 25 Mar 2010 09:01:26 +0000
Subject: [Rd] print(big+small*1i) -> big + 0i
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D70002AC3C28@NA-PA-VBE03.na.tibco.com>
References: <77EB52C6DD32BA4D87471DCD70C8D70002AC3C28@NA-PA-VBE03.na.tibco.com>
Message-ID: <4BAB2666.2040408@pburns.seanet.com>

I'm not sure it's awful either, but it
is surprising -- at least to my eye.

In particular, it is using the same
amount of real estate as it would to
print the "right" value.


Pat

On 25/03/2010 01:14, William Dunlap wrote:
> Should both parts of a complex number be printed
> to the same precision?   The imaginary part of 0
> looks a bit odd when log10(real/imag)>=~ getOption("digits"),
> but I'm not sure it is awful.  Some people might
> expect the same number of significant digits in the
> two parts.
>
>> 1e7+4i
> [1] 10000000+0i
>> 1e7+5i
> [1] 10000000+0i
>> 1e10 + 1000i
> [1] 1e+10+0e+00i
>> getOption("digits")
> [1] 7
>
>> options(digits=4)
>> 1e4+4i
> [1] 10000+0i
>> 1e7+1000i
> [1] 10000000+0i
>
>> version
>                 _
>
> platform       i386-pc-mingw32
>
> arch           i386
>
> os             mingw32
>
> system         i386, mingw32
>
> status         Under development (unstable)
>
> major          2
>
> minor          11.0
>
> year           2010
>
> month          03
>
> day            07
>
> svn rev        51225
>
> language       R
>
> version.string R version 2.11.0 Under development (unstable) (2010-03-07
> r51225)
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Patrick Burns
pburns at pburns.seanet.com
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')



[Rd] print(big+small*1i) -> big + 0i
Patrick Burns